Skip to content

Instantly share code, notes, and snippets.

View jesse-holden's full-sized avatar

Jesse Holden jesse-holden

View GitHub Profile

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

@kettanaito
kettanaito / README.md
Last active April 24, 2026 18:28
Publishing to npm in 2026

Prerequisites

  • Use Node.js v24. Trusted Publishing does not work on earlier versions of Node.js.

Steps

  1. Go to "Account > Access Tokens" and click "Generate Access Token".
  2. Give the new token "read and write" persmissions to "All packages".
  3. If you have 2FA enabled on npm (which you should), check the "Bypass 2FA" checkbox neatly hidden in the UI. Otherwise, npm will fail with an error demanding an OTP during automatic publishing.
  4. Create the token.
@kody-bot
kody-bot / why-i-migrated-from-bun-test-to-vitest.md
Created March 25, 2026 06:27
Why I migrated from Bun Test to Vitest

Why I migrated from Bun Test to Vitest

This is not a "Bun is slow" post. In my case, Bun was often fast. I switched because I stopped trusting the failure modes in the part of my test suite that spawned real processes and local infrastructure.

Context

I was testing a Cloudflare Worker app with a mix of:

  • plain unit tests
  • tests that spawn wrangler dev
@chenhunghan
chenhunghan / gist.md
Last active April 15, 2026 19:21
One Prompt to Save 90% Context for Any MCP Server

Local Code Mode for MCP

Most MCP servers just wrap CRUD JSON APIs into tools — I did it too with scim-mcp and garmin-mcp-app. It works, until you realize a tool call dumps 50KB+ into context.

MCP isn't dead — but we need to design MCP tools with the context window in mind.

@clmrb
clmrb / enum.js
Last active February 3, 2026 21:37
JavaScript enum function with working JSDoc autocompletion
/**
* @description
* Creates a frozen enumeration object where each key maps to its own string value.
* This is useful for defining a set of constant string values that can be referenced by name.
* This also avoids defining an object with duplicated string values manually.
* @template {string} T
* @param {...T} values
* @returns {{ [K in T]: K }}
* @example
* const Colors = Enum('Red', 'Green', 'Blue');
@mfrancis107
mfrancis107 / use-debounced-search-param.ts
Created November 6, 2025 15:20
Tanstack Search Param Debouncer
// src/routes/search/useDebouncedSearchParam.ts
import { useEffect, useMemo, useRef, useState } from 'react'
import { useDebouncedValue } from '@tanstack/react-pacer' // React adapter re-exports
// Alternative import also works in examples: '@tanstack/react-pacer/debouncer'.
// See Pacer React adapter docs. :contentReference[oaicite:5]{index=5}
type RouteSearchFrom<RouteApi> = RouteApi extends { types: { fullSearchSchema: infer TSchema } }
? TSchema extends Record<string, unknown>
? TSchema
: Record<string, unknown>
@skylord123
skylord123 / flow.json
Last active May 23, 2024 16:34
Node-RED integration with Torque Script
[{"id":"7b4f836b.c63e3c","type":"tcp out","z":"5fd187793239d604","name":"","host":"","port":"1881","beserver":"reply","base64":false,"end":false,"tls":"","x":560,"y":700,"wires":[]},{"id":"1993f5c2.4a154a","type":"tcp in","z":"5fd187793239d604","name":"","server":"server","host":"","port":"1881","datamode":"stream","datatype":"utf8","newline":"\\n\\n\\n","topic":"","trim":false,"base64":false,"tls":"","x":160,"y":580,"wires":[["d461697586d0556c"]]},{"id":"4c02e612c942936e","type":"inject","z":"5fd187793239d604","name":"Example data","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"commandToServer|action","payloadType":"str","x":190,"y":740,"wires":[["ccbe06d13f5d025c"]]},{"id":"ccbe06d13f5d025c","type":"function","z":"5fd187793239d604","name":"append newline","func":"msg.payload += \"\\n\";\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":380,"y":700,"wires":[["7b4f836b.c63e3c"]]},{"id":"7

This middleware does a few interesting things:

  • Ensures a url shape in the zustand store, where we'll store URL information.
  • Assumes we will be storing our url state slice in the ?state search parameter after it has been stringified and base 64 encoded.
  • On creation, decodes stores state from the ?state search parameter into the url slice of our store.
  • After each state update, updates the ?state search parameter with the new url state slice.
  • Sets up an event listener that listens for popstate and re-decodes the state from the URL into our store.
@gaearon
gaearon / 00-README-NEXT-SPA.md
Last active January 29, 2026 09:20
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.

@mjackson
mjackson / redirects-in-react-router-v6.md
Last active November 18, 2025 19:38
Notes on handling redirects in React Router v6, including a detailed explanation of how this improves on what we used to do in v4/5

Redirects in React Router v6

An important part of "routing" is handling redirects. Redirects usually happen when you want to preserve an old link and send all the traffic bound for that destination to some new URL so you don't end up with broken links.

The way we recommend handling redirects has changed in React Router v6. This document explains why.

Background

In React Router v4/5 (they have the same API, you can read about why we had to bump the major version here) we had a <Redirect> component that you could use to tell the router when to automatically redirect to another URL. You might have used it like this: