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
var range = function (from, to) { | |
if (arguments.length === 1) { to = from; } | |
var a = new Array(to + 1).join(0).split(0).map(function (v, i) { return i; }); | |
if (from !== to) { a = a.slice(from, a.length); } | |
return a; | |
}; |
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
!!(~('xxxXXXxxx').indexOf('xxx')); |
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
var spawn = function (generatorFn) { | |
var continuer = function (verb, arg) { | |
var r; | |
try { | |
r = generator[verb](arg); | |
} catch (error) { | |
return Promise.reject(error); | |
} |
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
var throwMissinParamError = function () { | |
throw new Error('Missing parameter'); | |
}, | |
requiredParamFn = function (requiredParam = throwMissinParamError()) { | |
// use required parameter | |
return requiredParam; | |
}; |
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
(new Array(101)).join(0).split(0).map(function (v, i) { | |
var r = ''; | |
i += 1; | |
(i%3 < 1) && (r += 'Fizz'); | |
(i%5 < 1) && (r += 'Buzz'); | |
!r && (r = i); | |
return r; | |
}).join('\n'); |
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
cd ~ | |
wget http://ftp.gnu.org/gnu/stow/stow-latest.tar.gz | |
tar -xf stow-latest.tar.gz | |
cd ~/stow-latest | |
./configure && make && sudo make install | |
cd ~ | |
wget https://www.kernel.org/pub/software/scm/git/git-2.1.3.tar.xz | |
tar -xf git-2.1.3.tar.xz | |
cd ~/git-2.1.3 | |
./configure && make && sudo make install |
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
var partial = function () { | |
var toArray = function (a) { return [].slice.call(a); }, | |
appliedArgs = toArray(arguments), | |
fn = appliedArgs.shift(), | |
placeholderPositions = appliedArgs.map(function (e, i) { | |
if (e === '_') { return i; } | |
}).join('').split(''); | |
return function () { | |
var args = toArray(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
JSON.parse( | |
((window.location.search) ? | |
window.location.search | |
.replace(/^\?/, '{"') | |
.replace(/=/g, '":"?') | |
.replace(/&/g, '"?,"') | |
.replace(/$/, '"}'): | |
'{}') | |
); |
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
var makeWorker = function (fn) { | |
var blobURL = URL.createObjectURL( | |
new Blob( | |
[ '(', fn.toString(), ')()' ], | |
{ type: 'application/javascript' } | |
) | |
), | |
worker = new Worker(blobURL); | |
return worker; |
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 init | |
git commit -m 'root commit' --allow-empty | |
touch README.md | |
echo "$(pwd | rev | cut -d"/" -f1 | rev)" >> README.md | |
git add . | |
git commit -m 'initial commit' | |
git remote add origin git@git.corp.yahoo.com:sdumas/$(pwd | rev | cut -d"/" -f1 | rev).git | |
git push -u origin master |
OlderNewer