I hereby claim:
- I am nimamehanian on github.
- I am nimamehanian (https://keybase.io/nimamehanian) on keybase.
- I have a public key ASAJNQGxsMuKcxAzb0zoKZOkmklWfLI0xa4C7SND8G1d4go
To claim this, I am signing this object:
| // test strings | |
| var str1 = 'the quick brown fox jumps over the lazy dog and this is probably the longest sentence you have ever come across because it just has so many words in it that it just runs on and on needlessly can you tell'; | |
| var str2 = 'Oh, what a harmony of abandonment and impulse, of unnatural and yet graceful postures, in that mystical language of limbs, freed from the weight of corporeal matter, marked quantity infused with new substantial form, as if the holy band were struck by an impetuous wind, breath of life, frenzy of delight, rejoicing song of praise miraculously transformed, from the sound that it was, into image.'; | |
| var rand = 'Oh, what a harmony of abandonment? and impulse!, of unnatural (and yet graceful) postures, in that mystical language of limbs, freed from the weight of corporeal matter, marked quantity infused with new substantial form; as if the holy band were struck by an impetuous wind, breath of life: frenzy of delight: rejoicing song of praise, miraculously transformed, fro |
I hereby claim:
To claim this, I am signing this object:
| const flattenDeep = array => ( | |
| array && array.constructor.name === 'Array' ? | |
| array.toString().split(',').map(num => +num) : [] | |
| ); |
| const data = [6, 5, 8, 4, 7, 10, 9]; | |
| const daysTillPlantDeath = (toxicities, daysElapsed) => { | |
| const livingPlants = toxicities.filter((poisonLevel, idx) => ( | |
| idx === 0 || (idx > 0 && poisonLevel <= toxicities[idx - 1]) | |
| )); | |
| return livingPlants.join('') === toxicities.join('') ? | |
| daysElapsed : daysTillPlantDeath(livingPlants, daysElapsed + 1); | |
| }; |
| const makeChange = (tier, divisors) => { | |
| if (!tier.length) { return false; } | |
| const nextTier = tier.reduce((t, n) => | |
| [...t, ...divisors.map(div => n - div)], [] | |
| ).filter(val => val > -1); | |
| return nextTier.indexOf(0) === -1 ? | |
| makeChange(nextTier, divisors) : true; | |
| }; | |
| makeChange([10], [3, 4]); |
| const gen0 = [ | |
| [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], | |
| [0, 0, 0, 0, 0, 0, 1, 1, 0, 0], | |
| [0, 0, 0, 1, 0, 0, 1, 0, 0, 0], | |
| [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], | |
| ]; | |
| // CONWAY GAME OF LIFE — CONSTRAINTS: | |
| // Any live cell with 0 or 1 live neighbors dies by underpopulation. | |
| // Any live cell with 2 or 3 live neighbors stays alive. |