This file contains hidden or 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 is NOT a cryptographically strong UUID algorithm | |
* It is purely for quick-n-easy drag-n-drop scripting applications where | |
* data quality does not matter. | |
* | |
* For a proper UUID implementation, see | |
* https://github.com/uuidjs/uuid/blob/master/src/v4.js | |
*/ | |
const max = Math.pow(2, 8) - 1 | |
// this slick trick thanks to https://github.com/uuidjs/uuid/blob/e8cb0a03a5408415d1f93a1499d8cda47246adc7/src/bytesToUuid.js#L7 |
This file contains hidden or 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
// Cargo.toml | |
// =============== | |
// [package] | |
// name = "flow-field-1" | |
// version = "0.1.0" | |
// authors = ["ericyd <[email protected]>"] | |
// | |
// [dependencies] | |
// nannou = "0.13" | |
// |
This file contains hidden or 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
User Registration | |
User enters phone number -> Send authentication SMS | |
Send authentication SMS | |
User taps authentication link -> Prove checks mobile identity | |
Prove checks mobile identity | |
User is valid -> Registration complete | |
User is invalid -> Error message | |
This file contains hidden or 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
/** | |
* Hosted at: https://gist.github.com/ericyd/c36ff66a40c3b7ede7ac9dd95ae260af | |
* Usage: | |
* cd my-local-git-repo | |
* curl https://gist.githubusercontent.com/ericyd/c36ff66a40c3b7ede7ac9dd95ae260af/raw/git-stats.js > git-stats.js | |
* node git-stats.js | |
*/ | |
const { exec } = require('child_process') | |
const { promisify } = require('util') |
This file contains hidden or 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
/** | |
* Running multiple validations asynchronously can present some interesting challenges, | |
* especially if the calling function should return a "result" type (or some other non-throwing value). | |
* There is even more complexity if you want to run the validations in sequence, | |
* and stop on the first failure. | |
* | |
* It is fairly easy to construct a meta function that executes the validators imperatively, | |
* but what if you want a more generic approach? | |
* This gist suggests a generic solution using generators, and slowly builds up the intuition | |
* until the final example shows a more realistic use case. |
OlderNewer