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 parallel = (...fs) => sequential( | |
| () => fs.map(f => f()), | |
| Promise.all.bind(Promise)); | |
| export const sequential = (f, ...fs) => val => Promise.resolve() | |
| .then(() => f(val)) | |
| .then(fs.length ? sequential(...fs) : id => id); |
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
| --log_gc (Log heap samples on garbage collection for the hp2ps tool.) | |
| type: bool default: false | |
| --expose_gc (expose gc extension) | |
| type: bool default: false | |
| --max_new_space_size (max size of the new generation (in kBytes)) | |
| type: int default: 0 | |
| --max_old_space_size (max size of the old generation (in Mbytes)) | |
| type: int default: 0 | |
| --max_executable_size (max size of executable memory (in Mbytes)) | |
| type: int default: 0 |
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
| //////////////////// | |
| // Exclude | |
| //////////////////// | |
| type MyExclude<T, L> = T extends L ? never : T; | |
| type TestExclude = MyExclude<"a" | "b" | "c" | "d", "a" | "b"> | |
| //////////////////// | |
| // Extract | |
| //////////////////// | |
| type MyExtract<T, L> = T extends L ? T : never; |
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
| version: "3.7" | |
| services: | |
| unleashDB: | |
| expose: | |
| - "5432" | |
| image: postgres:13 | |
| container_name: unleashDB | |
| networks: | |
| - internal |
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
| type RequireOnlyOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & { | |
| [K in Keys]-?: Required<Pick<T, K>>; | |
| }[Keys]; | |
| type PartialOnlyOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & { | |
| [K in Keys]?: Partial<Pick<T, K>>; | |
| }[Keys]; |
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 toCelsius(fahrenheit) { | |
| return (fahrenheit - 32) * 5 / 9; | |
| } | |
| function toFahrenheit(celsius) { | |
| return (celsius * 9 / 5) + 32; | |
| } |
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 createStore(reducer, preloadedState) { | |
| if(typeof reducer !== "function") { | |
| throw new Error("Reducer should be a function."); | |
| } | |
| if(typeof preloadedState === "function") { | |
| throw new Error("PreloadedState can't be a function."); | |
| } | |
| let currentState = preloadedState; |
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
| /** | |
| * This problem was asked by Robinhood. | |
| Given an array of strings, group anagrams together. | |
| For example, given the following array: | |
| ['eat', 'ate', 'apt', 'pat', 'tea', 'now'] | |
| Return: |
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 dfs(graph: Grid) { | |
| let max = 0; | |
| let islandsCount = 0; | |
| const visited: Grid<boolean> = [[], [], [], [], []]; | |
| for (let x = 0; x < graph.length; x++) { | |
| for (let y = 0; y < graph[x].length; y++) { | |
| if (!visited[x][y]) { | |
| islandsCount = 1 + can(graph, x, y, visited); |