- Use this for to lookup anything about js: https://developer.mozilla.org/en-US/
- Best short book series on js i know of https://github.com/getify/You-Dont-Know-JS/tree/1st-e
- https://www.youtube.com/watch?v=2d7s3spWAzo&list=PL0zVEGEvSaeEd9hlmCXrk5yUyqUag-n84&index=8
- https://www.youtube.com/watch?v=568g8hxJJp4&list=PL0zVEGEvSaeHJppaRLrqjeTPnCH6vw-sm&index=3
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
| const canvasWidth = 400 | |
| const canvasHeight = 400 | |
| function randomRange(min, max){ | |
| min = Math.ceil(min); | |
| max = Math.floor(max); | |
| return Math.floor(Math.random() * (max - min + 1)) + min; | |
| } | |
| function getLocation(){ |
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
| export const identity = (data) => () => data; | |
| export const partial = (fn, ...defaults) => (...args) => fn(...defaults, ...args); | |
| export const partialFlip = (fn, ...defaults) => (...args) => fn(...args, ...defaults); | |
| export const map = (fn) => (data) => Array.prototype.map.bind(data)(fn); | |
| export const filter = (fn) => (data) => Array.prototype.filter.bind(data)(fn); | |
| export const reduce = (fn, initial) => (data) => Array.prototype.reduce.bind(data)(fn, initial); | |
| export const compose = (...fns) => (data) => reduce((result, next) => next(result), data)(fns); | |
| export const composeFlip = (...fns) => compose(...fns.reverse()); | |
| export const compoesArray = (args) => compose(...args) | |
| export const compoesArrayFlip = (args) => composeFlip(...args) |
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
| fetch_observable(){ | |
| curl -O https://api.observablehq.com/${1}.js?v=3 | |
| } |
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
| #!/usr/bin/env bash | |
| # _ _ | |
| # __| | ___ | |_ | |
| # / _` |/ _ \| __| | |
| # | (_| | (_) | |_ | |
| # \__,_|\___/ \__| | |
| # | |
| # an old sysconf tool I replaced with https://github.com/slugbyte/mold | |
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
| for x in {0..15};do | |
| x=$(( x * 16 )) | |
| for y in {0..16};do | |
| color=$(( x + y )) | |
| echo -n $(tput setab $(( $color ))) $(tput setaf 15) | |
| printf " %3g " $color | |
| echo -n $(tput setab 0) | |
| done; | |
| echo "" | |
| done |
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
| G1s0MG0gG1s5N20gICAwICAbWzQwbRtbNDFtIBtbOTdtICAgMSAgG1s0MG0bWzQybSAbWzk3bSAgIDIgIBtbNDBtG1s0M20gG1s5N20gICAzICAbWzQwbRtbNDRtIBtbOTdtICAgNCAgG1s0MG0bWzQ1bSAbWzk3bSAgIDUgIBtbNDBtG1s0Nm0gG1s5N20gICA2ICAbWzQwbRtbNDdtIBtbOTdtICAgNyAgG1s0MG0bWzEwMG0gG1s5N20gICA4ICAbWzQwbRtbMTAxbSAbWzk3bSAgIDkgIBtbNDBtG1sxMDJtIBtbOTdtICAxMCAgG1s0MG0bWzEwM20gG1s5N20gIDExICAbWzQwbRtbMTA0bSAbWzk3bSAgMTIgIBtbNDBtG1sxMDVtIBtbOTdtICAxMyAgG1s0MG0bWzEwNm0gG1s5N20gIDE0ICAbWzQwbRtbMTA3bSAbWzk3bSAgMTUgIBtbNDBtG1s0ODs1OzE2bSAbWzk3bSAgMTYgIBtbNDBtChtbNDg7NTsxNm0gG1s5N20gIDE2ICAbWzQwbRtbNDg7NTsxN20gG1s5N20gIDE3ICAbWzQwbRtbNDg7NTsxOG0gG1s5N20gIDE4ICAbWzQwbRtbNDg7NTsxOW0gG1s5N20gIDE5ICAbWzQwbRtbNDg7NTsyMG0gG1s5N20gIDIwICAbWzQwbRtbNDg7NTsyMW0gG1s5N20gIDIxICAbWzQwbRtbNDg7NTsyMm0gG1s5N20gIDIyICAbWzQwbRtbNDg7NTsyM20gG1s5N20gIDIzICAbWzQwbRtbNDg7NTsyNG0gG1s5N20gIDI0ICAbWzQwbRtbNDg7NTsyNW0gG1s5N20gIDI1ICAbWzQwbRtbNDg7NTsyNm0gG1s5N20gIDI2ICAbWzQwbRtbNDg7NTsyN20gG1s5N20gIDI3ICAbWzQwbRtbNDg7NTsyOG0gG1s5N20gIDI4ICAbWzQwbRtbNDg7NTsyOW0gG1s5N20gIDI5ICAbWzQwbRtb |
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
| acp(){ | |
| git add . | |
| git commit -m "$(fortune)" | |
| git push origin HEAD | |
| } |
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
| function mix(state, block){ | |
| let select = block % 4 | |
| let zero = state[0] + (state[select] * block) ^ state[state[select] % 4] << 3 | block >> 5 | |
| let one = zero * (state[2] + state[3]) - state[1] | |
| let two = (state[2] >> (zero % 10)) - one | |
| let three = (state[3] ^ (two<<2)) ^ (state[select] >> 3) | |
| state = [zero , one, two, three].map(n => n & 0xffffffff) | |
| return state | |
| } |
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
| const {get, cloneDeep} = require('lodash/fp') | |
| // A TERRIBLE SIN I KNOW | |
| let oldLog = console.log.bind(console) | |
| console.log = (...args) => { | |
| args = args.map(i => i.isValueHistory ? i.get() : i) | |
| return oldLog(...args) | |
| } | |
| let valueHistory = (name='tracker') => { |
NewerOlder