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
... | |
<style> werk-er { display: none; } </style> | |
... | |
<werk-er id="zero"> | |
const f = new class { | |
constructor () { ... } | |
meth0 (x,y,z) { ... } | |
meth1 (x,y,z) { ... } | |
}(); | |
onmessage = (e, [a, ...b] = [...e.data]) => f[a](b); |
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 sortGoodBad = (r, f = x => Number(x)) => r.reduce( | |
(a, v) => (a[(f(v)) ? 0 : 1].push(v), a), [[], []] | |
); |
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 crandomValue = () => [...crypto.getRandomValues(new Uint32Array(1))].map(v => v / 4294967296.5)[0]; | |
const crandomArray = (n=1) => [...crypto.getRandomValues(new Uint32Array(n))].map(v => v / 4294967296.5); | |
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 sliceArrayOnCondition=(a,f)=>a.reduce((x,v,i)=>((isNaN(f)?f(v):i%f===0)&&i!==0?x.push([v]):x.at(-1).push(v),x),[[]]); |
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 // create a var ... | |
months // called months ... | |
= // that is equal to ... | |
[...Array(12)] // a twelve element array ... | |
.map( // that gets mapped using ... | |
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
('00000' + n).slice(-3) |
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
// run after all styles load | |
const cssVars = { | |
list : () => [...new Set([...[ | |
[...document.styleSheets] | |
.map(s => [...s.cssRules] | |
.map(r => r.cssText)), | |
[...document.querySelectorAll('[style]')] |
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 Liz = { | |
lizzers: [ | |
[obj, 'event', e=>{...}], | |
[obj, 'event,event,...', e=>{...}], | |
[obj, 'event,event,...', e=>{...},{ passive: true }] | |
], |
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 toNumArray = s => s.match(/[\d\.-]+/g).map(p=>Number(p)); |
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 xModByM = (x, M) => ((x % M) + M) % M; |
NewerOlder