cat file.txt | sed s/text/text2/ > file2.txt
scp username@hostname:/path/to/remote/file /local/path/to/copy/to/
find ./ -iname "index.php"
if (!Function.prototype.bind) { | |
Function.prototype.bind = function(oThis) { | |
if (typeof this != 'function') { | |
// closest thing possible to the ECMAScript 5 internal IsCallable function | |
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); | |
} | |
var | |
aArgs = Array.prototype.slice.call(arguments, 1), | |
f2Bind = this, |
;(function(window, undefined) { | |
'use strict'; | |
var global = window; | |
var doc = global.document; | |
var regXContainsTag = /^\s*<(\w+|!)[^>]*>/; | |
var dom = function(params, context) { | |
return new GetOrCreateDom(params, context); | |
}; |
var loadScript = function(url, callback) { | |
var s = document.createElement('script'); | |
s.type = 'text/javascript'; | |
s.async = true; | |
if (s.readyState) { // Internet Explorer | |
s.onreadystatechange = function() { | |
if (s.readyState == 'loded' || s.readyState == 'complete') { | |
s.onreadystatechange = null; | |
callback(); | |
} |
/* attribute selectors */ | |
/* <li class=""> or <li class> or <li class="foo"> */ | |
li[class] { background-color: gray; } | |
/* <li class="red"> exactly red */ | |
li[class="red"] { background-color: red; } | |
/* <li class="some other classes green"> targets space separated list of values */ | |
li[class~="green"] { background-color: green; } | |
/* <li class="blue-text"> target followed by hyphen */ | |
li[class|="blue"] { background-color: blue; } | |
/* <li class="bunch of classes and yellowish"> targets yellow */ |
var | |
worker = new Worker('js/worker.js') | |
, btn = document.getElementById('button') | |
; | |
worker.addEventListener('message', function(e) { | |
console.log('Worker said: ', e.data); | |
}, false); | |
btn.addEventListener('click', function(e) { |
(function(window) { | |
var resizeTimeoutId; | |
// instead replacing event attach | |
// if you want to consider other browsers use if (window.addEventListener) | |
// window.onresize = window_resize; | |
if (window.attachEvent) { | |
window.attachEvent('onresize', function() { | |
window_resize(e); | |
}); |
[ | |
// mimic keybindings of eclipse | |
// duplicate line | |
{ "keys": ["super+alt+down"], "command": "duplicate_line" } | |
// swapping lines | |
,{ "keys": ["alt+up"], "command": "swap_line_up" } | |
,{ "keys": ["alt+down"], "command": "swap_line_down" } | |
// multiple cursors |
# init repository | |
git init | |
# Adding files | |
git add filename or . # . adds all files |
cat file.txt | sed s/text/text2/ > file2.txt
scp username@hostname:/path/to/remote/file /local/path/to/copy/to/
find ./ -iname "index.php"
{ | |
"files": | |
{ | |
"jquery": "http://code.jquery.com/jquery.min.js" | |
, "backbone": "http://backbonejs.org/backbone-min.js" | |
, "underscore": "http://underscorejs.org/underscore-min.js" | |
, "handlebars": "https://raw.github.com/wycats/handlebars.js/1.0.0-rc.4/dist/handlebars.js" | |
, "normalize": "http://necolas.github.io/normalize.css/2.1.2/normalize.css" | |
}, | |
"packages": |