Skip to content

Instantly share code, notes, and snippets.

http://www.howtogeek.com/115051/become-a-vi-master-by-learning-these-30-key-bindings/
Mode Switching
As a short recap, vi is a modal editor – there’s an insert mode and a standard command mode. In insert mode, vi functions similar to a normal text editor. In command mode, you take advantage of these key bindings.
i – Enter insert mode.
Escape – Leave insert mode. If you’re already in command mode, Escape does nothing, so you can press Escape to ensure you’re in command mode.
Moving the Cursor
Vi uses the hjkl keys to move the cursor in command mode. Early computer systems didn’t always have arrow keys, so these keys were used instead. One advantage of these keyboard shortcuts is that you don’t have to move your fingers from the home row to use them.
@davidvanvickle
davidvanvickle / php-curl-post.php
Created September 22, 2011 02:40
php curl post and write to file
$ch = curl_init($post_url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array('data1'=>'val','data2'=>'val2')));
$data_str = curl_exec($ch);
curl_close($ch);
file_put_contents($path_to_xml_data,$data_str);
@davidvanvickle
davidvanvickle / php-curl-get-json.php
Created September 22, 2011 02:36
php curl get json
$ch = curl_init('http://domain.com?'.http_build_query(array('type'=>'stuffIndex','request'=>'getIt')));
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$resp = curl_exec($ch);
curl_close($ch);
$d = json_decode($resp,true);
if ($d && isset($d['akey'])) {
}
@davidvanvickle
davidvanvickle / git-notes.txt
Last active September 27, 2015 07:28
GIT notes
Pull to web host
git init
git remote add origin git@github.com:username/domain.git .
git pull origin master
http://nvie.com/posts/a-successful-git-branching-model/
branches: