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
// A simple way to extract strings and numbers from an enum | |
enum actions { | |
Link = 1, | |
Unlink = 0 | |
} | |
const strings = Object.keys(actions) | |
.filter((key) => Number.isNaN(parseFloat(key))) |
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
[alias] | |
b = branch -vv | |
ba = branch -a -vv | |
bb = branch | |
cb = checkout -b | |
cm = checkout master | |
cma = checkout main | |
cnv = commit -m --no-verify | |
co = checkout | |
d = branch -D |
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 promise = (number) => new Promise(resolve => { | |
setTimeout(() => resolve(number), Math.random() * Math.floor(1000)) | |
}) | |
const sequentialIteration = async () => { | |
for (const number of Array(10).keys()) console.log(await promise(number)) | |
} | |
sequentialIteration() |
NewerOlder