Based on http://67.media.tumblr.com/db4e1af67392bcc850a74a7270425885/tumblr_o88m45M9cl1twrbr9o1_540.gif
This file contains hidden or 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
#!/usr/bin/env node | |
const _tasks = {} | |
function task (name, fn) { | |
_tasks[name] = fn | |
} | |
task.run = async function (name, wait) { | |
if (!name) return console.warn(`Usage: node task [name]`) | |
if (!_tasks[name]) return console.warn(`No task named ${name}`) |
This file contains hidden or 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 fsck --no-reflogs | awk '/dangling commit/ {print $3}'| while read hash; do | |
echo "$hash" | |
git show $hash | grep -H -C4 svg | |
done |
This file contains hidden or 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 AbortablePromise (fn) { | |
var abortHandler; | |
function onAbort (abortFn) { | |
abortHandler = abortFn; | |
} | |
var promise = new Promise(function (resolve, reject) { | |
fn.call(null, resolve, reject, onAbort); |
This file contains hidden or 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
Verifying I am +ricardobeat on my passcard. https://onename.com/ricardobeat |
This file contains hidden or 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
Promise.prototype.spread = function (fn) { | |
this.then(function (values) { | |
fn.apply(this, values) | |
}) | |
} | |
function when () { | |
var requirements = Array.prototype.slice.call(arguments, 0) | |
return Promise.all(requirements.map(function(name){ |
This file contains hidden or 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 () { | |
var doc = document.documentElement | |
var IE7 = navigator.userAgent.indexOf('MSIE 7') > 0 | |
logpane = document.createElement('div') | |
var height = 180 | |
var width = 480 | |
document.body.appendChild(logpane) | |
logpane.style.background = '#fff' | |
logpane.style.padding = '10px' | |
logpane.style.position = IE7 ? 'absolute' : 'fixed' |
This file contains hidden or 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
#!/usr/bin/env node | |
var fs = require('fs') | |
var path = require('path') | |
var dir = process.argv[2] | |
if (!dir) throw new Error('Usage: ./chess.js path-to-pgn-files/ ') | |
var white = 0 | |
var black = 0 |
This file contains hidden or 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 _e () { | |
local color; local escape; local newline; local bold=0 | |
if [[ $1 == "bold" ]]; then | |
shift; bold=1 | |
fi | |
case $1 in | |
white ) color=37 ;; | |
red ) color=31 ;; | |
green ) color=32 ;; | |
yellow ) color=33 ;; |