"engines": { "node": "8.9.1" },
"scripts": {
"version": "echo $npm_package_version",
"node-version": "node -p 'require(\"./package.json\").engines.node'"
}
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 hookStreamWrite = (stream, callback) => { | |
const oldWrite = stream.write; | |
stream.write = callback((...args) => oldWrite.apply(stream, args)); | |
return () => { | |
stream.write = oldWrite; | |
}; | |
}; | |
/* Example */ |
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
// subscribe to online / offline events | |
// (bool -> undefined) -> () -> undefined | |
const subscribeOnline = (cb) => { | |
const online = () => cb(true); | |
const offline = () => cb(false); | |
window.addEventListener('online', online, false); | |
window.addEventListener('offline', offline, false); | |
return function unsubscribe() { | |
window.removeEventListener('online', online); |
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
// @async File -> DataUrl | |
const fileDataUrl = (file) => { | |
return new Promise((resolve, reject) => { | |
const reader = new FileReader(); | |
reader.onload = () => resolve(reader.result); | |
reader.onerror = reject; | |
reader.readAsDataURL(file); | |
}); | |
} |
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
// inverse of callbackify | |
exports.promisify = (func) => (...args) => { | |
return new Promise((resolve, reject) => { | |
func(...args, (err, data) => { | |
err ? reject(err) : resolve(data); | |
}); | |
}); | |
}; | |
// inverse of promisify |
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
tag_commit: | |
<<: *job_defaults | |
environment: | |
AWS_ACCOUNT_ID: 000000000000 | |
AWS_REGION: us-east-1 | |
steps: | |
- <<: *setup_remote_docker | |
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 factorial = Y(f => n => n > 1 ? n * f(n - 1) : 1); | |
const Y = f => (x => x(x))(y => f(x => y(y)(x))); |
I hereby claim:
- I am colbydauph on github.
- I am colbydauphinais (https://keybase.io/colbydauphinais) on keybase.
- I have a public key ASDX29Uwv9FQnc_8pjKfZrPnWMroWUTG5eBX332iqSG51Qo
To claim this, I am signing this object: