Skip to content

Instantly share code, notes, and snippets.

@valk
valk / llm-wiki.md
Created April 11, 2026 18:49 — forked from karpathy/llm-wiki.md
llm-wiki

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.

@valk
valk / multiple_ssh_setting.md
Last active January 3, 2022 14:10 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

How to access multiple github accounts with different SSH Keys settings

Create different public keys

create different ssh keys according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "user1@example.com"
@valk
valk / HowTo: Sorted disk usage (du)
Created December 6, 2020 15:06 — forked from antespi/HowTo: Sorted disk usage (du)
List first level directories inside a directory, sorted by size. Useful when your disk is full and you are searching something to erase or move elsewhere.
du -k -d1 * | sort -nr | cut -f2 | xargs -d '\n' du -sh
@valk
valk / small_vega_chart.json
Created October 1, 2020 22:41
Small series chart with Vega
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"height": 60,
"width": 120,
"padding": 0,
"autosize": "fit",
"description": "Google's stock price over time.",
"data": {
"url": "data/stocks.csv"
},
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Search</title>
<style>
body { margin: 0; box-sizing: border-box; }
.header { width: 100%; height: 36px; background: #DAE3ED; padding: 14px; color: #111; }
.search { margin: 0 40px; }
.search__input { height: 26px; width: 40%; border-radius: 4px; padding: 4px 8px;
@valk
valk / server.rb
Last active August 29, 2015 14:10
Tiny server that allows working with static files or anything else written in Ruby.
#!/usr/bin/env ruby
#
# In order to run:
# > ruby server.rb
#
# Or add execution permissions and run:
# > ./server.rb
#
# Then point your browser to http://localhost:1234/your_file.html
@valk
valk / wheregem.rb
Created November 22, 2014 20:52
Find the location of the specified gem. Usage: ruby wheregem.rb activerecord
gemname = ARGF.argv[0]
spec = Gem::Specification.find_by_name(gemname)
gem_root = spec.gem_dir
gem_lib = gem_root + "/lib"
puts gem_lib
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
diff --git a/gc.c b/gc.c
--- a/gc.c
+++ b/gc.c
@@ -77,6 +77,41 @@ void *alloca ();
#ifndef GC_MALLOC_LIMIT
#define GC_MALLOC_LIMIT 8000000
#endif
+#define HEAP_MIN_SLOTS 10000
+#define FREE_MIN 4096
+
#!/usr/bin/env bash
# Tested for Ubuntu 12.04
[[ "$(id -u)" -ne "0" ]] && echo "must be root!" && exit 1
RBVER="1.9.3-p194"
apt-get update
apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev wget rsync