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:
const { log } = console; | |
console.clear(); | |
const logHof = fn => (...args) => { | |
log('logHof') | |
log(args); | |
return fn(...args); | |
}; | |
const incrementHof = fn => (x, y) => { |
const { log, clear } = console | |
const reduceI = addIndex(reduce); | |
const HUMAN = 'X'; | |
const COMPUTER = 'O'; | |
class Board { | |
constructor({ | |
rows = 4, |
/* 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 => { |
I hereby claim:
To claim this, I am signing this object:
const { log } = console; | |
const trace = (tag) => (x) => { | |
log(`\n${tag}\n==================================================`); | |
log(JSON.stringify(x, 0, 2)); | |
return x; | |
} |
const { log, clear } = console; | |
clear() | |
const trace = (tag) => (x) => { | |
log(`\n${tag}\n==================================================`); | |
log(JSON.stringify(x, 0, 2)); | |
return x; | |
} | |
// misc.js | |
/////////////////////////////////////////////////////////////////////////////////////// |
// 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`), | |
) | |
)] |
# Enable tab completion of flags | |
source $(dirname $(gem which colorls))/tab_complete.sh | |
# Move standard ls | |
alias ols="ls" | |
# Base formats | |
alias ls="colorls -A" # short, multi-line | |
alias ll="colorls -1A" # list, 1 per line | |
alias ld="ll" # ^^^, NOTE: Trying to move to this for alternate hand commands | |
alias la="colorls -lA" # list w/ info |
const R = require('ramda') | |
const { Logger } = require('../logger') | |
// higher order "plugin" factories; these functions accept | |
// a factory, add functionality to it, and then return it | |
const locksHof = require('./locksHof') | |
const loggerHof = require('./methodLoggerHof') | |
const speakHof = require('./speakHof') | |
// create a "base" higher-order factory that has adds the methods |
// `tryCatch` is useful when you want to do assignment and have a sane default | |
// The value provided is not parseable, so we get `{}` because there was an error | |
tryCatch(JSON.parse, always({}))('{{50') | |
// {} | |
// Here, the value is parseable, so we get the parsed object literal | |
tryCatch(JSON.parse, always({}))('{ "foo": "HI" }') | |
// {"foo": "HI"} |