I hereby claim:
- I am rjhilgefort on github.
- I am rjhilgefort (https://keybase.io/rjhilgefort) on keybase.
- I have a public key ASDJQfOqOlsZCq_eKVHu4Vn3-qJVIaQv3fbLXPMcQCFhawo
To claim this, I am signing this object:
// validateRequired :: [String] | String a -> a | ThrownError | |
const validateRequired = propOrPath => R.cond([ | |
[isString, R.compose(validateRequired, R.of)], | |
[R.T, path => R.when( | |
R.pathSatisfies(R.isNil, path), | |
R.compose( | |
fpThrow, | |
R.always(`"${path}" is required and must be present`), | |
) | |
)] |
const { log, clear } = console; | |
clear() | |
const trace = (tag) => (x) => { | |
log(`\n${tag}\n==================================================`); | |
log(JSON.stringify(x, 0, 2)); | |
return x; | |
} | |
// misc.js | |
/////////////////////////////////////////////////////////////////////////////////////// |
const { log } = console; | |
const trace = (tag) => (x) => { | |
log(`\n${tag}\n==================================================`); | |
log(JSON.stringify(x, 0, 2)); | |
return x; | |
} |
I hereby claim:
To claim this, I am signing this object:
/* eslint-disable no-console */ | |
import * as R from 'ramda'; | |
import util from 'util'; | |
const inspect = R.compose( | |
R.flip, | |
R.curryN(2), | |
)(util.inspect); | |
export default x => { |
const { log, clear } = console | |
const reduceI = addIndex(reduce); | |
const HUMAN = 'X'; | |
const COMPUTER = 'O'; | |
class Board { | |
constructor({ | |
rows = 4, |
const { log } = console; | |
console.clear(); | |
const logHof = fn => (...args) => { | |
log('logHof') | |
log(args); | |
return fn(...args); | |
}; | |
const incrementHof = fn => (x, y) => { |
console.clear() | |
/////////////////////////////////////////////////////////////// | |
// promise-utils.js | |
// PromiseAll :: Promise.all | |
const PromiseAll = (x) => Promise.all(x) | |
// thenP :: Function -> Promise -> Promise | |
const thenP = |
class ConsecutiveFailure { | |
constructor({ | |
count = 0, | |
threshold = 10, | |
logger = console.log, | |
}) { | |
this.count = count; | |
this.threshold = threshold; | |
this.logger = logger; | |
} |
// NOTE: Ramda repl | |
console.clear() | |
const foo = (a, b) => a + b | |
const bar = () => 4 | |
const tryYolo = curry((func, params) => { | |
try { | |
return apply(func, params) |