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
import React, {type ReactNode} from 'react' | |
import {type CreateEditorStateProps} from 'remirror' | |
import { | |
BoldExtension, | |
ItalicExtension, | |
UnderlineExtension, | |
BulletListExtension, | |
OrderedListExtension, | |
HardBreakExtension, |
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
import React from 'react' | |
import useSWR, { type Fetcher, type Key, type SWRConfiguration, type SWRResponse } from 'swr' | |
type ArgumentsTuple = [any, ...unknown[]] | readonly [any, ...unknown[]] | |
type StrictTupleKey = ArgumentsTuple | null | undefined | false | |
type StrictKey = StrictTupleKey | (() => StrictTupleKey) | |
type SetKey<T> = React.Dispatch<React.SetStateAction<T>> | |
export function useLazySWR< |
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
/* eslint-env node */ | |
import ts from 'typescript' | |
import {TypeGenAddonFactory} from 'ts-graphql-plugin' | |
import {astf} from 'ts-graphql-plugin/lib/ts-ast-util' | |
const typedQueryDocumentAddon: TypeGenAddonFactory = ({source}) => ({ | |
operationDefinition({tsResultNode, tsVariableNode}) { | |
const lhs = astf.createIdentifier(`${tsResultNode.name.text}Document`) | |
const rhs = astf.createTypeReferenceNode( |
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
/** | |
* Moved to a new repository. | |
* https://github.com/intrnl/firefox-revert-proton | |
*/ | |
:root { | |
--tab-min-height: 28px !important; | |
--toolbarbutton-inner-padding: 6px !important; | |
--toolbarbutton-outer-padding: 1px !important; | |
--toolbar-start-end-padding: 1px !important; |
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
import React, { type ReactNode } from 'react'; | |
import { useSearchParams } from 'react-router-dom'; | |
import { type QueryParamConfig } from 'serialize-query-params'; | |
export * from 'serialize-query-params'; | |
const SearchParamsContext = React.createContext<ReturnType<typeof useSearchParams> | null>(null); | |
interface SearchParamsProviderProps { | |
children?: ReactNode; |
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
#!/usr/bin/env -S bash | |
## credits to https://paste.sh/1QS8Tgf6#aHTfRy1dOG4rcA5x_6kauwq3 | |
#pkg=current/xbps-0.59.1_6.x86_64.xbps | |
pkg=current/dolphin-22.08.2_1.x86_64.xbps | |
otime=current/otime | |
file="${XDG_CACHE_HOME:-$HOME/.cache}/${0##*/}-results" | |
mirrormsg() { printf '%s\n' "getting mirrors from void-docs..." ; } |
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
// This attendance counting function assumes the following: | |
// - You can attend multiple times in one day (and still be counted as one) | |
// - Attendance time is not counted, you can attend for several minutes and it still counts as one day | |
/** @typedef {string | number | Date} DateLike */ | |
/** | |
* @param {Array<{ start: DateLike, end: DateLike }>} attendances | |
* @param {Date} startDate | |
* @param {Date} endDate |
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
/** | |
* @typedef {object} Reader | |
* @property {(p: Uint8Array) => Promise<number | null>} read | |
*/ | |
/** | |
* @typedef {object} Seeker | |
* @property {(offset: number) => Promise<number>} seek | |
*/ |
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
/** | |
* Create an async iterable for a readable stream | |
* @template T | |
* @param {ReadableStream<T>} stream | |
* @returns {AsyncIterableIterator<T>} | |
*/ | |
function createStreamIterator (stream) { | |
// return if browser already supports async iterator in stream | |
if (stream[Symbol.asyncIterator]) { | |
return stream; |
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
function assert (condition, message = 'Assertion failed') { | |
if (!condition) { | |
throw new Error(message); | |
} | |
} | |
export class ByteReader { | |
/** | |
* @param {ArrayBuffer} buffer | |
* @param {number} [offset] |