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
| import R from 'ramda' | |
| export async function mapAsync<Type, ReturnedType>( | |
| promiseFunc: (value: Type) => Promise<ReturnedType>, | |
| values: Type[], | |
| chunk = 3 | |
| ) { | |
| const processChunk = processWithFunction<Type, ReturnedType>(promiseFunc) | |
| const chunks = R.splitEvery(chunk, values) | |
| return R.flatten(await R.reduce(processChunk, Promise.resolve([]), chunks)) |
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
| import { PerformanceObserver, performance } from 'perf_hooks'; | |
| import R from "ramda"; | |
| const perfObserver = new PerformanceObserver((items) => { | |
| items.getEntries().forEach((entry) => { | |
| console.log(`${entry.name}: ${entry.duration}}`) | |
| }) | |
| }) | |
| perfObserver.observe({entryTypes: ["measure"]}) |
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 branch-title | |
| set -l branch $argv[1] | |
| if test -z "$branch" | |
| set branch (git branch --show-current) | |
| end | |
| echo $branch | sed -E \ | |
| 's|^([^/]+)/([a-zA-Z]+)-([0-9]+)-(.*)$|\1(\U\2\E-\3): \L\4|; s|-| |g; s|\(([A-Z]+) ([0-9]+)\)|(\1-\2)|' | |
| end |
OlderNewer