| name | explain-diff-html |
|---|---|
| description | Use when the user asks for a rich explanation of a code change, diff, branch, or PR. Produces HTML output. |
Please make me a rich, interactive explanation of the specified code change.
It should have these sections:
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.
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.
| """ | |
| The most atomic way to train and run inference for a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |
| #!/usr/bin/env bash | |
| # Script to force RGB Color Output on M1 and M2 based Macs for a selected display | |
| # Function to display an error message and exit | |
| function error_exit { | |
| echo "Error: $1" >&2 | |
| exit 1 | |
| } |
This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.
Update: I've disabled comments as of 2025-01-26 to avoid everyone having notifications for something a year on if someone wants to suggest a correction. Folks are free to email to suggest corrections still, of course.
| # Runs "$@" in a subshell with the caller's options, sets reply=(stdout stderr) | |
| # and returns the status of the executed command. Both stdout and stderr are | |
| # captured completely, including NUL bytes, incomplete UTF-8 characters and | |
| # trailing LF, if any. | |
| # | |
| # Example: | |
| # | |
| # % zsh-run-command ls -d ~ /garbage | |
| # % printf 'status: %s\nstdout: %s\nstderr: %s\n' $? "${(q+)reply[@]}" | |
| # status: 2 |
Functions that allow you to call a function not more than once in a given timeframe.
This can be illustrated with timing diagrams. In the following diagrams, f designates call to the throttled function, t is the period where the timer is running, and x shows you the actual execution point of the throttled function.
f 1 2 3 4 5 6