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
# vim bindings to focus splits | |
keybind = cmd+ctrl+h=goto_split:left | |
keybind = cmd+ctrl+j=goto_split:bottom | |
keybind = cmd+ctrl+k=goto_split:top | |
keybind = cmd+ctrl+l=goto_split:right | |
# delete to start of line | |
keybind = cmd+backspace=esc:w | |
keybind = global:cmd+control+.=toggle_quick_terminal |
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 { Hono } from "hono"; | |
import { serve } from "@hono/node-server"; | |
import { serveStatic } from "@hono/node-server/serve-static"; | |
import { reactRouter } from "remix-hono/handler"; | |
// @ts-ignore | |
import * as build from "./build/server"; | |
const app = new Hono(); | |
app.use( | |
"*", |
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 { Kysely } from "kysely"; | |
import { PlanetScaleDialect } from "kysely-planetscale"; | |
import { type z } from "zod"; | |
import * as Models from "./prisma/generated/zod/modelSchema"; | |
type RemoveSchema<S extends string> = S extends `${infer Prefix}Schema` ? Prefix : S; | |
export type Database = { | |
[K in keyof typeof Models as RemoveSchema<K>]: z.infer<(typeof Models)[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
import type { Kysely, RawBuilder } from "kysely"; | |
import type { Account } from "next-auth"; | |
import type { | |
Adapter, | |
AdapterSession, | |
VerificationToken, | |
AdapterUser, | |
} from "next-auth/adapters"; | |
import type { DB } from "shared"; |
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 { useEffect, useState } from "react"; | |
import * as swc from "@swc/wasm-web"; | |
let __initialized = false; | |
type SWC = Omit<typeof swc, "default" | "initSync">; | |
let __swc: SWC; | |
export default function useSwc() { | |
const [initialized, setInitialized] = useState(__initialized); | |
const [_swc, setSwc] = useState<SWC>(__swc); |
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
// npm i clsx react-aria | |
import clsx from 'clsx'; | |
import Link, { LinkProps } from 'next/link'; | |
import React, { AnchorHTMLAttributes, useRef } from 'react'; | |
import { type AriaLinkOptions, useLink } from 'react-aria'; | |
export default function LLink( | |
props: AnchorHTMLAttributes<HTMLAnchorElement> & { | |
children: React.ReactNode; | |
next?: LinkProps; |
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 autosize from "autosize"; | |
import { forwardRef, useEffect, useRef } from "react"; | |
const AutosizeTextarea = forwardRef< | |
HTMLTextAreaElement, | |
React.DetailedHTMLProps< | |
React.TextareaHTMLAttributes<HTMLTextAreaElement>, | |
HTMLTextAreaElement | |
> & { | |
onResize?: (target: HTMLTextAreaElement) => void; |
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
// npm i usehooks-ts | |
import { useEffect } from "react"; | |
import { useDarkMode } from "usehooks-ts"; | |
export function useTheme() { | |
const theme = useDarkMode(); | |
useEffect(() => { | |
if (theme.isDarkMode) { | |
document.body.classList.add("dark"); |
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 { getYjsValue, syncedStore } from "@syncedstore/core"; | |
import { | |
DocTypeDescription, | |
MappedTypeDescription, | |
} from "@syncedstore/core/types/doc"; | |
import { useSyncedStore } from "@syncedstore/react"; | |
import { createContext, useContext, useEffect, useState } from "react"; | |
import { WebsocketProvider } from "y-websocket"; | |
import * as Y from "yjs"; |
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
// i like trpc. i like autocomplete. i like vercel/serverless. | |
// netlify acquired quirrel. | |
// theo would shill for a type safe option. | |
// there's a gap for a type-safe scheduling/cron/queuing/realtime and i want to fill it. | |
// also, quirrel has weird syntax for | |
// framing: typescript-first bindings for what you would typically use redis for | |
const appRouter = createRouter(); |
NewerOlder