I hereby claim:
- I am tehshrike on github.
- I am tehshrike (https://keybase.io/tehshrike) on keybase.
- I have a public key whose fingerprint is 3B94 CC2A 2C46 7B35 2F61 F71F 545D 7CD7 3324 13D2
To claim this, I am signing this object:
| function escape(str) { | |
| return str.replace(/\\/g, '\\\\').replace(/'/g, "\\'").replace(/\n/g, "\\n") | |
| } | |
| console.log(escape(require('fs').readFileSync('index.js', { encoding: 'utf8' }))) |
| [diff] | |
| tool = bcomp | |
| [difftool] | |
| prompt = false | |
| [difftool "bcomp"] | |
| trustExitCode = true | |
| cmd = "/usr/local/bin/bcomp" "$LOCAL" "$REMOTE" | |
| [merge] | |
| tool = bcomp | |
| [mergetool] |
I hereby claim:
To claim this, I am signing this object:
| function singleNumberToXY(number, boardWidth) { | |
| var x = number % boardWidth | |
| var y = (number - x) / boardWidth | |
| return { | |
| x: x, | |
| y: y | |
| } | |
| } | |
| function test(number, width) { |
| var encloseifNecessary = function(value) { | |
| if (typeof value === 'string') { | |
| return "'" + escape(value) + "'" | |
| } else { | |
| // TODO: add further handling for arrays or whatever maybe | |
| return value | |
| } | |
| } | |
| var escape = function(value) { |
| // Imagine that this is somebody else's async tool that you're using | |
| var doAsyncThing = function(thing, cb) { | |
| cb(thing + '!') | |
| } | |
| // So you have this utility function | |
| var callThisWhenTheThingsAreDone = function(callback, number_of_things_to_do) { | |
| var things_done = 0 | |
| return function() { | |
| things_done++ |
| var variable = function() { | |
| console.log(this.var || "NO U") | |
| } | |
| variable.variable = variable | |
| variable.var = "lol" | |
| variable() | |
| variable.variable.variable.variable.variable() |
| var functionThatCallsItselfMultipleTimes = function(starting_number) { | |
| if (starting_number === 1) { | |
| console.log("THING DONE!") | |
| } else { | |
| var roughly_half_the_number = Math.floor(starting_number / 2) | |
| functionThatCallsItselfMultipleTimes(starting_number - roughly_half_the_number) | |
| functionThatCallsItselfMultipleTimes(roughly_half_the_number) | |
| } | |
| } |