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 { Liveblocks, LiveList } from "@liveblocks/node"; | |
/** | |
* This script is used to push a list of items to a Liveblocks room. | |
* We're mutating the list, by pushing 150 items, so the final list should have 150 items, | |
* but we never get 150 items back, it's always less. | |
* | |
* For running the script use Node 24 (it allows to run .ts directly using node only): | |
* | |
* ```node |
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 { | |
useCallback, | |
useState, | |
} from "react" | |
/** | |
* Allows to use a Set as a state more conveniently. | |
*/ | |
export function useSet<T>(initialValues?: Iterable<T> | null) { | |
const [set, setSet] = useState<Set<T>>(new Set(initialValues)) |
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
# source: https://gist.github.com/srflp/2da77871ed5e41edab913b3aaac85ba9 | |
# put this file in <your-repo>/.github/workflows/zip-top-level-directories.yml | |
name: Zip top-level directories | |
on: | |
push: | |
branches: | |
- main | |
jobs: |
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
// Barcode Detector API Types | |
// remove these types after they get implemented in TypeScript | |
type BarcodeFormat = | |
| 'aztec' | |
| 'code_128' | |
| 'code_39' | |
| 'code_93' | |
| 'codabar' | |
| 'data_matrix' |