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-app-polyfill/ie11'; | |
import * as ReactDOM from 'react-dom'; | |
import { | |
theme, | |
ArrowLeftIcon, | |
ArrowRightIcon, | |
ArrowDiagonalIcon, | |
CollectionsIcon, | |
Dropdown, | |
} from '../'; |
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 Item = () => { | |
const progress = useScrollProgress() | |
return <motion.div style={{ opacity: progress }} /> | |
} | |
const App = () => { | |
return ( | |
<Scroll.Section | |
start={{ section: 'start', container: 'center' }} | |
end={{ section: 'end', container: 'center' }} |
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 { Box, Center, Flex, Grid, Stack, Text } from "@chakra-ui/react"; | |
import React, { ReactNode } from "react"; | |
export interface TableProps<T extends { id: string }> { | |
children: ReactNode; | |
data: T[]; | |
emptyLabel?: string; | |
} | |
export interface ColumnDefinition { |
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 { BinstaClient } from 'binsta'; | |
const FOLDER_ID = 'nw6iuC4rIK'; | |
const binsta = new BinstaClient(process.env.API_TOKEN); | |
const file = await binsta.files.get('JZ7tbWj45g'); | |
const root = await binsta.folders.get('root'); | |
const untitled = await binsta.folders.create(); | |
const photos = await binsta.folders.create({ name: 'photos' }); |
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 { Webhooks, Event } from "@resend/next"; | |
// do signing secret check internally to verify entity calling endpoint | |
const webhooks = new Webhooks(process.env.RESEND_SIGNING_SECRET); | |
webhooks.on(Event.EmailDelivered, (data) => { | |
// data object is fully-typed according to event type | |
}); | |
webhooks.on(Event.EmailOpened, (data) => { |
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
// TLDR: simply copy/paste into dev console and then try some searches | |
const cmp = new Intl.Collator("en").compare; | |
const inf = Infinity; | |
const INTRA_BOUND = "[A-Za-z][0-9]|[0-9][A-Za-z]|[a-z][A-Z]"; | |
const OPTS = { | |
// term segmentation & punct/whitespace merging |
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
class PartSimulator { | |
terminals: TerminalSimulator[]; | |
terminalsByGroup: Record<number, TerminalSimulator[]>; | |
terminalsByName: Record<string, TerminalSimulator>; | |
constuctor(part: db.types.Part) { | |
this.terminals = this.constructor.terminals.map((terminalDefinition) => { | |
return new TerminalSimulator({ | |
...terminalDefinition, |
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 circuit = { | |
parts: [ | |
{ | |
id: "1", | |
type: "breadboard", | |
parentId: null, | |
position: { | |
x: 0, | |
y: 0, | |
z: 0, |
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 { useScroll } from 'framer-motion'; | |
const Navbar = () => { | |
const scroll = useScroll(); | |
const [timeRemaining, setTimeRemaining] = React.useState(readTime); | |
React.useEffect(() => { | |
return scroll.scrollYProgress.onChange((progress) => { | |
setTimeRemaining(Math.floor(readTime * (1 - progress))); | |
}); |