Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
/* | |
* Normalized hide address bar for iOS & Android | |
* (c) Scott Jehl, scottjehl.com | |
* MIT License | |
*/ | |
(function( win ){ | |
var doc = win.document; | |
// If there's a hash, or addEventListener is undefined, stop here | |
if( !location.hash && win.addEventListener ){ |
-webkit-border-radius: 3px 3px 0 0; | |
-khtml-border-radius: 3px 3px 0 0; | |
-moz-border-radius: 3px 3px 0 0; | |
-ms-border-radius: 3px 3px 0 0; | |
-o-border-radius: 3px 3px 0 0; | |
border-radius: 3px 3px 0 0; |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
<?php | |
function get_client_ip() { | |
if(isset($_SERVER["HTTP_X_FORWARDED_FOR"])) { | |
if(isset($_SERVER["HTTP_CLIENT_IP"])) { | |
return $_SERVER["HTTP_CLIENT_IP"]; | |
} else { | |
return $_SERVER["REMOTE_ADDR"]; | |
} | |
return $_SERVER["HTTP_X_FORWARDED_FOR"]; |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
" Search Dash for word under cursor | |
function! SearchDash() | |
let s:browser = "/usr/bin/open" | |
let s:wordUnderCursor = expand("<cword>") | |
let s:url = "dash://".s:wordUnderCursor | |
let s:cmd ="silent ! " . s:browser . " " . s:url | |
execute s:cmd | |
redraw! | |
endfunction | |
map <leader>d :call SearchDash()<CR> |
" Searches Dash for the word under your cursor in vim, using the keyword | |
" operator, based on file type. E.g. for JavaScript files, I have it | |
" configured to search j:term, which immediately brings up the JS doc | |
" for that keyword. Might need some customisation for your own keywords! | |
function! SearchDash() | |
" Some setup | |
let s:browser = "/usr/bin/open" | |
let s:wordUnderCursor = expand("<cword>") |
#!/bin/bash | |
# PHP CodeSniffer pre-commit hook for git | |
# | |
# @author Soenke Ruempler <soenke@ruempler.eu> | |
# @author Sebastian Kaspari <s.kaspari@googlemail.com> | |
# | |
# see the README | |
PHPCS_BIN=/usr/bin/phpcs | |
PHPCS_CODING_STANDARD=PEAR |
compass compile --force | |
sed -i -e "s/^@charset.*$//g" public/stylesheets/*.css | |
jammit --force |
body { | |
font-family: Helvetica, arial, sans-serif; | |
font-size: 14px; | |
line-height: 1.6; | |
padding-top: 10px; | |
padding-bottom: 10px; | |
background-color: white; | |
padding: 30px; | |
color: #333; | |
} |