Based on http://67.media.tumblr.com/db4e1af67392bcc850a74a7270425885/tumblr_o88m45M9cl1twrbr9o1_540.gif
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 sequentialTest(control, treatment, sample) { | |
if (treatment - control >= 2.25 * Math.sqrt(sample)) { | |
return 'treatment wins' | |
} else if (control - treatment >= 2.25 * Math.sqrt(sample)) { | |
return 'control wins' | |
} else if (treatment + control >= sample) { | |
return 'stop test. no winner' | |
} | |
return 'continue testing' |
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
const BUCKETS = 100 | |
function toInt32(buf) { | |
return Math.abs(new Uint8Array(buf).slice(0,4).reduce((p,c) => p << 8 | c, 0)) | |
} | |
async function hash(input){ | |
const data = new TextEncoder().encode(input); | |
const buf = await crypto.subtle.digest("SHA-256", data); | |
return toInt32(buf) |
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
// https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9393C5-L9399C8 | |
var groupBy = createAggregator(function(result, value, key) { | |
if (hasOwnProperty.call(result, key)) { | |
result[key].push(value); | |
} else { | |
baseAssignValue(result, key, [value]); | |
} | |
}); | |
// https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L4818C5-L4825C6 |
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
brew 'coreutils' | |
brew 'tmux' | |
brew 'jq' | |
brew 'htop' | |
brew 'wget' | |
brew 'tree' | |
brew 'aria2' | |
brew 'xcbeautify' | |
brew 'git' |
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
<!doctype html> | |
<body></body> | |
<script> | |
const events = [ | |
'click', | |
'input', | |
'change', | |
'mouseenter', | |
'mouseleave', |
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
const { task, read, write } = require('taks') | |
const _postcss = require('postcss') | |
const _rollup = require('rollup') | |
const _uglify = require('uglify-es') | |
const postcss = task.plugin(async function (input, output, options) { | |
let opts = Object.assign({ from: undefined, plugins: [] }, options) | |
let src = await read(input) | |
let { css } = await _postcss(opts.plugins).process(src, opts) | |
return write(output, css) |
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
#!/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 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 |
NewerOlder