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
| vim afile # Open a file | |
| ^w v # split it | |
| gg # go to top | |
| :set scrollbind # bind this one | |
| ^w l # go to the new split | |
| L # go to bottom of this split | |
| zt # make it the top line | |
| :set scrollbind # bind with this one |
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 random = (min, max) => Math.floor(Math.random() * (max - min)) + min; | |
| /* https://www.joshwcomeau.com/snippets/react-hooks/use-random-interval */ | |
| export const useRandomInterval = (callback, minDelay, maxDelay) => { | |
| const timeoutId = React.useRef(null); | |
| const savedCallback = React.useRef(callback); | |
| React.useEffect(() => { | |
| savedCallback.current = callback; | |
| }, [callback]); | |
| React.useEffect(() => { |
NewerOlder