This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git diff ${GIT_HASH} --summary | grep --color 'mode change 100755 => 100644' | cut -d' ' -f7- | xargs -d'\n' chmod +x | |
git diff ${GIT_HASH} --summary | grep --color 'mode change 100644 => 100755' | cut -d' ' -f7- | xargs -d'\n' chmod -x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bind(o, fn) { | |
return function() { | |
return fn.apply(o, arguments); | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hasClass(el, cls) { | |
var reg = new RegExp('(\\s|^)' + cls + '(\\s|$)'); | |
return reg.test(el.className); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addClass(el, cls) { | |
if (!hasClass(el, cls)) { | |
el.className += (el.className ? ' ': '') + cls; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function removeClass(el, cls) { | |
var reg; | |
if (hasClass(el, cls)) { | |
reg = new RegExp('(\\s|^)' + cls + '(\\s|$)'); | |
el.className = el.className.replace(reg,' ').replace(/^\s+|\s+$/g, ''); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toggleClass(el, cls) { | |
if (hasClass(el, cls)) { | |
removeClass(el, cls); | |
} else { | |
addClass(el, cls); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function timer() { | |
var date = new Date(); | |
return function () { | |
return (((new Date()).getTime() - date.getTime())/1000); | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isoDateString(d) { | |
function pad(n) { | |
return n < 10 ? '0' + n : n; | |
} | |
return d.getUTCFullYear() + '-' + | |
pad(d.getUTCMonth()+1) + '-' + | |
pad(d.getUTCDate()) + 'T' + | |
pad(d.getUTCHours()) + ':' + | |
pad(d.getUTCMinutes()) + ':' + | |
pad(d.getUTCSeconds()) + 'Z'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function curry(fn) { | |
var slice = Array.prototype.slice, | |
args = slice.call(arguments).slice(1); | |
return function () { | |
return fn.apply(null, args.concat(slice.call(arguments))); | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function beget(o) { | |
function F() {} | |
F.prototype = o; | |
return new F(); | |
} |
OlderNewer