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 { createParser, useQueryState } from 'nuqs' | |
| import { z } from 'zod' | |
| export function createZodCodecParser< | |
| Input extends z.ZodCoercedString<string>, | |
| Output extends z.ZodType | |
| >( | |
| codec: z.ZodCodec<Input, Output>, | |
| eq: (a: z.output<Output>, b: z.output<Output>) => boolean = (a, b) => a === b | |
| ) { |
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
| ID: 8200971789968 – Title: Simon Willison's Weblog | |
| URL: https://simonwillison.net/atom/everything/ | |
| ID: 7836475734291 – Title: Aurora Scharff | |
| URL: https://aurorascharff.no/rss.xml | |
| ID: 6174072093989 – Title: Vercel News | |
| URL: https://vercel.com/atom | |
| ID: 6042486240080 – Title: kettanaito.com |
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
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <title>Vanilla</title> | |
| </head> | |
| <body> | |
| <label style="display: flex; gap: 0.5rem; align-items: center"> | |
| <input type="range" id="slider" /> | |
| <span id="value"></span> |
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
| #main-window { | |
| min-width: 400px !important; | |
| } | |
| /* Hide the shield (tracking protection) icon */ | |
| #tracking-protection-icon-container { | |
| display: none !important; | |
| } | |
| /* Hide site information (lock icon) */ |
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
| #include <MIDI.h> | |
| #include <string.h> | |
| MIDI_CREATE_DEFAULT_INSTANCE(); | |
| template<unsigned Size, typename DataType> | |
| struct MessageQueue { | |
| static constexpr unsigned sMask = Size - 1; | |
| inline MessageQueue<Size, DataType>() |
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
| { | |
| "explorer.experimental.fileNesting.enabled": true, | |
| "explorer.experimental.fileNesting.patterns": { | |
| "*.ts": "$(capture).js, $(capture).d.ts, $(capture).test.ts", | |
| "*.js": "$(capture).js.map, $(capture).min.js, $(capture).d.ts, $(capture).test.js", | |
| "*.jsx": "$(capture).js", | |
| "*.tsx": "$(capture).ts, $(capture).*.ts, $(capture).*.tsx", | |
| "tsconfig.json": "tsconfig.*.json", | |
| "docker-compose.yml": "docker-compose.*.yml", | |
| ".env": ".env.*", |
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 type { Stripe } from 'stripe' | |
| export type StripeWebhookEventTypes = | |
| Stripe.WebhookEndpointCreateParams.EnabledEvent | |
| export type StripeWebhookEvent< | |
| EventType extends StripeWebhookEventTypes, | |
| Payload | |
| > = { | |
| eventType: EventType |
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
| /** | |
| * Traverse a JSON object depth-first, in a `reduce` manner. | |
| * | |
| * License: MIT © 2021 François Best (https://francoisbest.com) | |
| * | |
| * @param input The root node to traverse | |
| * @param callback A function to call on each visited node | |
| * @param initialState Think of this as the last argument of `reduce` | |
| */ | |
| export function reduceTree<State>( |
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
| { | |
| "colors": { | |
| "green": { | |
| "50": "#ECF8EF", | |
| "100": "#CBECD2", | |
| "200": "#A9DFB6", | |
| "300": "#88D399", | |
| "400": "#66C77C", | |
| "500": "#45BA60", | |
| "600": "#37954D", |
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
| Array.from( | |
| new Set( | |
| // List all links on the page | |
| Array.from(document.getElementsByTagName('a')) | |
| .filter(a => | |
| // Only keep status URLs | |
| a.href.match(/^https:\/\/twitter\.com\/(\w+)\/status\/(\d+)$/) | |
| ) | |
| .map(a => a.href) // Keep only the link URL | |
| ) // new Set: remove duplicates |
NewerOlder