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
| (() => { | |
| const FIRST_ELEMENT_SELECTOR = ".Panel[data-index]"; | |
| const ROOT_ELEMENT_SELECTOR = "[data-index]"; | |
| const DATA_ID_NAME = "data-rfd-draggable-id"; | |
| const DATA_ID_SELECTOR = `[${DATA_ID_NAME}]`; | |
| const WAIT_FOR_TIME = 500; | |
| async function waitForElementLoaded(parent, selector) { | |
| await new Promise((resolve) => { | |
| const observer = new MutationObserver((mutations) => { |
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 UnionToIntersection<U> = ( | |
| U extends never ? never : (arg: U) => never | |
| ) extends (arg: infer I) => void | |
| ? I | |
| : never; | |
| type UnionToTuple<T> = UnionToIntersection< | |
| T extends never ? never : (t: T) => T | |
| > extends (_: never) => infer W | |
| ? [...UnionToTuple<Exclude<T, W>>, W] |
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
| A set of typescript compose fucntions. |
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
| // Event loop: | |
| Promise.resolve().then(() => {console.log('a')}) | |
| setTimeout(() => {console.log('b')},0); | |
| console.log('c'); | |
| // Temporal dead zone: | |
| var a = 10; | |
| { | |
| console.log(a); | |
| const a = 20; |
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
| /* | |
| After purchasing a humble book bundle, go to your download page for that bundle. | |
| Open a console window for the page and paste in the below javascript | |
| */ | |
| function windowsNormalize(path) { | |
| return path.replace( /[<>:"\/\\|?*]/g, '_' ); | |
| } | |
| function getTitle() { |