aspe:keyoxide.org:ZL3FSZRDPZ5SFGE5UU5SYWPCCQ
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 ReversedSymbol = Symbol('reversed'); | |
type ScoreScalar = string | number | boolean; | |
type Score = ScoreScalar | [ScoreScalar, typeof ReversedSymbol]; | |
export type ScoreFunction<T> = (item: T) => Score; | |
function getResult<T>( | |
scoreFns: readonly ScoreFunction<T>[], | |
itemResults: Map<T, [Score, boolean][]>, | |
item: T, |
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 proxyPromise(promise) { | |
const acc = []; | |
function createFnProxy(prop) { | |
return function(...args) { | |
acc.push([prop, args]); | |
return proxy; | |
}; | |
} |
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
// Based on Darts, Dice, and Coins: Sampling from a Discrete Distribution | |
// http://www.keithschwarz.com/darts-dice-coins/ | |
export default class AliasVose { | |
constructor(list) { | |
// Determine relative probabilities. | |
const scalar = list.length / | |
list.reduce((acc, item) => { return acc + item.weight; }, 0); | |
// Partition outcomes into tiny and big work queues. |
I hereby claim:
- I am duncanbeevers on github.
- I am duncanbeevers (https://keybase.io/duncanbeevers) on keybase.
- I have a public key whose fingerprint is 3DC2 C013 05E7 E510 3F75 A78C BE1A 0744 BEC4 A007
To claim this, I am signing this object:
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
.col-md-12 | |
hr | |
div | |
ab-checkbox(shadow-model="project.sendErrorEmail") Send email when an error occurred | |
ab-checkbox(shadow-model="project.sendCommentEmail") Send email when someone commented | |
ab-checkbox(shadow-model="project.sendOnlyProductionEmail") | |
| Send Notify for | |
.label.production | |
i.burk.burk-environment | |
| Production |
I hereby claim:
- I am duncanbeevers on github.
- I am duncanbeevers (https://keybase.io/duncanbeevers) on keybase.
- I have a public key whose fingerprint is F03C 58AC 2B3E 019E 3F3D CCA5 2543 E9A0 A5D8 984D
To claim this, I am signing this object:
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
isConstant = require('constantinople') | |
toConstant = require('constantinople').toConstant | |
Compiler = (node, options) -> | |
compile: -> | |
visitTag = (tag) -> | |
buffer('React.DOM.' + tag.name + '(') | |
visitAttributes(tag.attrs, tag.attributeBlocks) | |
visitArgs(tag) | |
buffer(')') |
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 toQueryString(obj) { | |
var ret = []; | |
function add(dest, key, val) { | |
var type = Object.prototype.toString.call(val), i, len; | |
if ("[object Array]" === type) { | |
// Array | |
for (i = 0, len = val.length; i < len; i++) { add(dest, key + "[]", val[i]); } | |
} else if ("[object Object]" === type) { |
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
App.setupWithOptions | |
orange: "very" | |
fragrant: "barely" |
NewerOlder