Official Site

click here to view our new site launched

Pages

Thursday, March 21, 2013

Command Line Mac Os

On Mac OS X (and Linux), vi is symlinked to vim (vi improved), a more modern free software version. Vim It is the default editor when changing a crontab.

Vi has two modes, command and insert (really, three if you count replace mode). Command mode is used to navigate, search, and issue other commands. Insert mode is used to enter text.

While in command mode (case sensitive)

move the cursor with arrow keys; if there aren't any arrow keys, use j,k,h,l

i - change to insert mode (before cursor)
a - change to insert mode (after cursor)
A - change to insert mode (at end of line)
r - replace one character
R - overwrite text
x - delete one character
dd - delete one line
yy - yank line (copy)
p - paste deleted or yanked text after cursor
P - paste deleted or yanked text before cursor
G - go to end of the file
1G - go to top of the file
J - merge next line with this one
/ - search, follow / with text to find
:wq - write file and quit
:q! - quit without saving
%s/old/new/g - substitute; replace "old" with "new" on all lines
:g/pattern/d - delete all lines that match the pattern

While in insert mode

ESC - change to command mode
any text typed is entered at the cursor

Typical vi session

Type "vi file.txt" at command prompt
Move cursor to where new text will be added
Type "i" to change to insert mode
Type new text
Type ESC to go back to command mode
type ":wq" and ENTER to write the file and quit



Support us at Sync4Brain

Monday, March 4, 2013

How to Get Facebook,G+,Twitter Like for an Url in PHP


You need the call the bellow functions to get value:

  • call get_plusones($url)  to get G+ count
  • call get_likes($url) to get Facebook Likes count
  • call get_tweets($url) to get Count of tweet for the url

function get_plusones($url) {

    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, "https://clients6.google.com/rpc");
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS,
 '[{"method":"pos.plusones.get","id":"p","params":{"nolog":true,"id":"' . $url . '","source":"widget","userId":"@viewer","groupId":"@self"},"jsonrpc":"2.0","key":"p","apiVersion":"v1"}]');
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
    $curl_results = curl_exec($curl);
    curl_close($curl);
    $json = json_decode($curl_results, true);
    return intval($json[0]['result']['metadata']['globalCounts']['count']);
}

function get_likes($url) {

    $json_string = file_get_contents('http://graph.facebook.com/?ids=' . $url);
    $json = json_decode($json_string, true);

    return intval( $json[$url]['shares'] );
}

function get_tweets($url) {
    $json_string = file_get_contents("http://urls.api.twitter.com/1/urls/count.json?url=$url");
    $json = json_decode($json_string, true);

    return intval($json['count']);
}

Saturday, March 2, 2013

YouTube Videos Download Trick

Download YOU-TUBE videos on your computer or mobile without any software

Follow this Very simple trick:

Go to YouTube, Open the video that you want to download
  1. Now you have to make a small change in video link [ Replace "www." to "ss"] For example http://www.youtube.com/watch?v=EWnNyT3QTSQ http://ssyoutube.com/watch?v=EWnNyT3QTSQ
  2. After it will redirect to a new site http://en.savefrom.net/
  3. Now you have to choose the format of the video like mp4,3gp,flv and also shows the video quality like 240p,360p,720p,1080p

$2.49 .COM at GoDaddy.com! Expires 5/14/13