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
| //////////////////////////////////////////////////////////////////////////////// | |
| // Create a directory called "pages" next to | |
| // this file, put markdown files in there, and | |
| // then run: | |
| // | |
| // ``` | |
| // $ node build.mjs | |
| // ``` | |
| // | |
| // Then deploy the "build" directory somewhere. |
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
| /* eslint-disable no-inner-declarations */ | |
| import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment'; | |
| let isEnabled = false; | |
| if (canUseDOM) { | |
| /** | |
| * Web browsers emulate mouse events (and hover states) after touch events. | |
| * This code infers when the currently-in-use modality supports hover | |
| * (including for multi-modality devices) and considers "hover" to be enabled |
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 Animated, { | |
| useSharedValue, | |
| withTiming, | |
| useAnimatedStyle, | |
| Easing, | |
| makeRemote, | |
| withSpring, | |
| processColor, | |
| useValue, | |
| delay as RDelay, |
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 useScrollRestoration from "utils/hooks/useScrollRestoration"; | |
| const App = ({ Component, pageProps, router }) => { | |
| useScrollRestoration(router); | |
| return <Component {...pageProps} />; | |
| }; | |
| export default App; |
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 is a worker that can be deployed in a desperate situation in order | |
| // to disable all service worker caching by overwriting the running worker | |
| // with a no-op worker. | |
| // | |
| // Keep it close for when you need it. | |
| self.addEventListener("install", () => { | |
| // Activate immediately, taking control from any broken service workers | |
| self.skipWaiting(); | |
| }); |
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 * as React from "react"; | |
| import { TouchableOpacity, Text } from "react-native"; | |
| import { Notifications } from "expo" | |
| import { useNotification } from "./useNotification"; | |
| const sendNotification = async () => await Notifications.presentLocalNotificationAsync( | |
| { | |
| title: "Notified!", | |
| body: "Hello, World!", | |
| data: {} |
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 React, { useRef, useEffect, memo } from 'react' | |
| import { useRouter } from 'next/router' | |
| const ROUTES_TO_RETAIN = ['/dashboard', '/top', '/recent', 'my-posts'] | |
| const App = ({ Component, pageProps }) => { | |
| const router = useRouter() | |
| const retainedComponents = useRef({}) | |
| const isRetainableRoute = ROUTES_TO_RETAIN.includes(router.asPath) |
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
| // Target state | |
| var tx = 0; | |
| var ty = 0; | |
| var scale = 1; | |
| function visualiseTargetState() { | |
| box.style.transform = `translate(${tx}px, ${ty}px) scale(${scale})`; | |
| } |
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
| // web | |
| import P, { ArrowContainer } from 'react-tiny-popover' | |
| import React from 'react' | |
| export default ({ | |
| visible = false, | |
| position, | |
| onClose, | |
| children, | |
| content = null, |