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
import fs from 'node:fs' | |
import path from 'node:path' | |
let opts = {} | |
process.argv.forEach(function (val, index, array) { | |
if (val.startsWith('--')) { | |
opts[val.slice(2)] = process.argv[index+1] | |
} | |
}); |
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 = 120 // multiple of 3 for correct split on 3-variant experiments | |
const seed = '8fc40cab' // random seed, change to reallocate users | |
function hashFNV(s, h = 0x811c9dc5) { | |
for (let i = 0; i < s.length; i++) { | |
h ^= s.charCodeAt(i); | |
h += (h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24); | |
} | |
return h >>> 0; | |
} |
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