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
package kvtable | |
import ( | |
"fmt" | |
"strings" | |
) | |
type Row struct { | |
Key string | |
Value string |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
{} |
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
/** | |
* | |
* @param {number} multiplier The RSU to options ratio. A value of `3` would mean 3 options to 1 RSU. | |
* @param {number} strike The dollar amount of the options strike price. | |
*/ | |
function calc(multiplier, strike) { | |
const percent = 1 / (multiplier - 1); | |
const currentPrice = strike * (percent + 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
const kegbotMachine = new Machine( | |
{ | |
id: "kegbot", | |
initial: "unauthenicated", | |
context: { | |
userID: null, | |
pourAmount: 0, | |
pourSelection: 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
const task = Machine({ | |
id: 'task', | |
initial: 'loading', | |
states: { | |
loading: { | |
on: { | |
ERROR: 'error', | |
AVAILABLE: 'available', | |
}, | |
}, |
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
interface FulfilledPromise<T> { | |
status: 'fulfilled'; | |
value: T; | |
} | |
interface RejectedPromise { | |
status: 'rejected'; | |
reason: string; | |
} |
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
package throttle | |
import ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
type concurrencyLock struct { | |
locker chan struct{} |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"strconv" | |
"strings" | |
"sync" | |
"time" | |
) |
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 konamiCode(cb) { | |
const UP = 38; | |
const DOWN = 40; | |
const LEFT = 37; | |
const RIGHT = 39; | |
const KONAMI_CODE = [UP, UP, DOWN, DOWN, LEFT, RIGHT, LEFT, RIGHT].join('-'); | |
let keypresses = []; | |
let enabled = false; | |
let rootEl = null; | |
let passive = false; |
NewerOlder