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
// TODO: make `pages` optional and measure the div when unspecified, this will | |
// allow more normal document flow and make it easier to do both mobile and | |
// desktop. | |
import { | |
createContext, | |
useCallback, | |
useContext, | |
useEffect, | |
useMemo, | |
useRef, |
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 Task = run => ({ | |
// (a -> e) -> (a -> r) -> Task(a) // Might be inaccurate idk | |
run, | |
// undefined -> undefined | |
log: () => | |
run(console.error) | |
(console.log), | |
// (a -> b) -> Task(b) |
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 href="javascript:(function(){if(document.body.contentEditable==='true'){document.body.contentEditable='false';}else{document.body.contentEditable='true';}})();">Edit this</a> | |
<br> | |
<a href="javascript:(function(){regex=/\/(edit|view)/;path=location.pathname;if(regex.test(path))location.pathname=path.replace(regex, '/preview');})();">Preview google drive</a> | |
<br> | |
<a href="javascript:(function(){Runner.instance_.loadImages();style=document.createElement('style');document.head.appendChild(style);style.sheet.insertRule('.snackbar-show { animation: unset }');})();">Unblock chrome://dino</a> | |
<br> | |
<a href="javascript:(function(){editor=document.querySelector('div.commit-create > div.CodeMirror');editor.setAttribute('style'%2C'height%3A50%25');})();">Enlarge gist edit window</a> | |
<br> | |
<a href="javascript:Array.from(document.querySelectorAll('.tv-dialog__modal-wrap, .tv-dialog__overlay')).forEach(e => e.remove());">Clean tradingview</a> | |
<br> |
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 ext = (...suffix) => new RegExp(`\\.(?:${ suffix.join('|') })(?:[?#].*)?$`) | |
const loaders = [ | |
// Traditional cases | |
{ test: ext('css'), loaders: ['style', 'css'] }, // single | |
{ test: ext('js', 'jsx', 'es6'), loaders: ['babel'] }, // multiple | |
// Complex case: Font-Awesome adds query strings and/or hashs to files | |
{ test: ext('otf', 'eot', 'svg', 'ttf', 'woff', 'woff2'), loaders: ['file?name=[name].[ext]'] }, | |
] |