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 payload<D, E>() { | |
| const arr: { data?: D, error?: E } & ((_: any) => void)[] = [(data) => { arr.data = data }, (error) => { arr.error = error }]; | |
| return arr; | |
| } | |
| const useForceUpdate = () => Object.assign.apply(null, useReducer(({ current }) => ({ current: current + 1 }), { current: 0 }).reverse()); | |
| function useFetch<D, E, R = { data?: D, error?: E }>(fetcher, deps = []) { | |
| const forceUpdate = useForceUpdate(); | |
| const ref = useRef<R>(payload()); |
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
| // DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| // Version 2, December 2004 | |
| // Copyright (C) 2004 Sam Hocevar <[email protected]> | |
| // Everyone is permitted to copy and distribute verbatim or modified | |
| // copies of this license document, and changing it is allowed as long | |
| // as the name is changed. | |
| // DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
| @tailwind base; | |
| @tailwind components; | |
| @tailwind utilities; | |
| #aside-controller:checked+aside { | |
| transform: translateX(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
| export function createPendingValue<T, Ref = any, S = never>(ref: Ref, key: keyof Ref) { | |
| let resolve!: (v: T) => void; | |
| let reject!: (reason?: any) => void; | |
| const p = new Promise<T>((_resolve, _reject) => { | |
| resolve = value => { | |
| ref[key] = value as Ref[keyof Ref]; | |
| _resolve(value); | |
| }; |
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
| // ==UserScript== | |
| // @name urlbox-example | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description try to take over the world! | |
| // @author You | |
| // @match https://*/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=bing.com | |
| // @grant none | |
| // ==/UserScript== |
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
| nvm use | |
| npm install --location=global pnpm@${$(cat package.json | jq -r '.engines.pnpm // "latest"'):-latest} | |
| npm install --location=global yarn@${$(cat package.json | jq -r '.engines.yarn // "latest"'):-latest} | |
| npm install --location=global npm@${$(cat package.json | jq -r '.engines.npm // "latest"'):-latest} |
OlderNewer