!function() {
// Code in here is encapsulated
}();
Note that !
or +
is safer than ()
because ()
could invoke preceding code.
[alias] | |
co = checkout | |
ci = commit | |
ca = commit --amend | |
cia = commit -a | |
can = commit --amend --no-edit | |
com = checkout master | |
st = status | |
s = status --short | |
b = branch |
/^(?!(corn|bread)$).+/.test('corn') // false (blacklisted) | |
/^(?!(corn|bread)$).+/.test('bread') // false (blacklisted) | |
/^(?!(corn|bread)$).+/.test('cornbread') // true (not blacklisted) | |
/^(?!(corn|bread)$).+/.test('corndog') // true (not blacklisted) | |
/^(?!(corn|bread)$).+/.test('read') // true (not blacklisted) |
.DS_Store | |
*.[gtGT][iI][fF] | |
*.[jJ][pP][gG] | |
*.[jJ][pP][eE][gG] | |
*.[hH][eE][iI][cfCF] | |
*.[pP][nN][gG] | |
*.[wW][eE][bB][pP] |
function pure(like) { | |
var fresh = [] | |
var i = ~~like.length | |
while (i-->0) fresh[i] = like[i] | |
return fresh | |
} |
(function(root, name, make) { | |
if (typeof module != 'undefined' && module['exports']) module['exports'] = make(); | |
else root[name] = make(); | |
}(this, 'breakpoint', function() { | |
/** | |
* @link http://gist.github.com/ryanve/7924792 | |
* @param {string} feature range feature name e.g. "width" | |
* @param {string=} unit CSS unit for feature e.g. "em" | |
* @param {number=} init initial guess |
document.addEventListener('keyup', function(e) { | |
9 != e.keyCode || e.metaKey || e.ctrlKey || console.log(document.activeElement) | |
}, false) |
!function() { | |
var emitter = { | |
emit: console.dir.bind(console) | |
} | |
function emit(mutation) { | |
var target = mutation.target | |
var name = mutation.attributeName | |
var value = target.getAttribute(name) |
document.addEventListener('focusin', function() { | |
console.log(document.activeElement) | |
}, false) |