LearningsReact Content Security Policy with nonce04.01.24 · 2 min
// the whole retry wrapper
async function retry(fn, n = 5) {
for (let i = 0; ; i++) {
try { return await fn() }
catch (e) { if (i >= n) throw e }
await sleep(2 ** i * 100)
}
}
TechnologyClean up GitHub workflow runs in terminal02.21.24 · 1 min
~/notes15notes, written the week it broke
LearningsRemove node_modules from all folders11.18.20 · 1 min
“Creating simple REST end points in Go”— rest api's in go
$ lsof -ti tcp:3000
41873
$ kill -9 41873
✓ port 3000 is free
LearningsMock Framer Motion with Jest10.19.20 · 1 min
LearningsFallback image if image is not found in picture source tag10.18.20 · 1 min
LearningsStop Port in Terminal07.23.20 · 1 min
// leap years, the whole rule
const leap = (y) =>
(y % 4 === 0 && y % 100 !== 0)
|| y % 400 === 0
InterviewsMatrix Rotation in JavaScript07.12.20 · 1 min
“Interview problem to generate all possible combinations of alphabets from a phone dial pad on number input”— find all possible combination of alphabets from a phone dial pad using javascript