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
| // from this tweet https://twitter.com/mattpocockuk/status/1622730173446557697 | |
| type Prettify<T> = { | |
| [K in keyof T]: T[K] | |
| } & {}; |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <gesmes:Envelope xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01" xmlns="http://www.ecb.int/vocabulary/2002-08-01/eurofxref"> | |
| <gesmes:subject>Reference rates</gesmes:subject> | |
| <gesmes:Sender> | |
| <gesmes:name>European Central Bank</gesmes:name> | |
| </gesmes:Sender> | |
| <Cube> | |
| <Cube time='2023-05-25'> | |
| <Cube currency='USD' rate='1.0735'/> |
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 fs from "fs"; | |
| import express from "express"; | |
| import { WebSocketServer } from "ws"; | |
| import { NodeWSServerAdapter } from "@automerge/automerge-repo-network-websocket"; | |
| import { NodeFSStorageAdapter } from "@automerge/automerge-repo-storage-nodefs"; | |
| import os from "os"; | |
| import type { DocumentId, PeerId } from "@automerge/automerge-repo"; | |
| import { | |
| isValidAutomergeUrl, | |
| isValidDocumentId, |
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 fs from "fs"; | |
| import express from "express"; | |
| import { WebSocketServer } from "ws"; | |
| import { NodeWSServerAdapter } from "@automerge/automerge-repo-network-websocket"; | |
| import { NodeFSStorageAdapter } from "@automerge/automerge-repo-storage-nodefs"; | |
| import os from "os"; | |
| import type { DocumentId, Message, PeerId } from "@automerge/automerge-repo"; | |
| import { | |
| isValidAutomergeUrl, | |
| isValidDocumentId, |
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 { sql, type TransactionSQL } from "bun"; | |
| const [, , ...flags] = Bun.argv; | |
| import { readdir } from "node:fs/promises"; | |
| const MIGRATIONS_DIR = "./migrations"; | |
| const makeMigration = (name: string) => { | |
| const timestamp = new Date().toISOString().split(".")[0].replace(/\D/g, ""); | |
| const migrationName = `${timestamp}_${name}`; | |
| const migrationPath = `${MIGRATIONS_DIR}/${migrationName}.ts`; |
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
| // Drop this into your console then call it with an input selector, a string, and a delay to have it automatically type for | |
| // you. For demo videos and such. | |
| async function fakeType(text, selectorString = '.cm-content', delay = 50) { | |
| const element = document.querySelector(selectorString); | |
| if (!element) { | |
| console.error(`fakeType Error: Element with selector "${selectorString}" not found.`); | |
| return Promise.reject(new Error(`Element with selector "${selectorString}" not found.`)); | |
| } |
OlderNewer