Skip to content

Instantly share code, notes, and snippets.

View nataliefl's full-sized avatar

Natalie Lien nataliefl

  • Iterate AS
  • Oslo
View GitHub Profile
@nataliefl
nataliefl / llm-wiki.md
Created May 22, 2026 12:00 — 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.

@nataliefl
nataliefl / gist:21880de378d266237c6c8fe7781f836b
Created July 15, 2020 06:59
Create id without collision guarantee
Math.random().toString(16).slice(2)
@nataliefl
nataliefl / daemonset-amd64.yaml
Last active October 25, 2021 03:16
kube-proxy setup for amd64 and arm architecture
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
labels:
k8s-app: kube-proxy
name: kube-proxy-amd64
namespace: kube-system
spec:
revisionHistoryLimit: 10
selector:
@nataliefl
nataliefl / v8regex.js
Created July 28, 2017 08:29
v8 regex caching
//https://stackoverflow.com/questions/14352100/does-v8-cache-compiled-regular-expressions-automatically
function isFooBar(str) {
return str.match(/^(?:(?=.*[a-z])(?:(?=.*[A-Z])(?=.*[\d\W])|(?=.*\W)(?=.*\d))|(?=.*\W)(?=.*[A-Z])(?=.*\d)).{8,}(?:(?=.*[a-z])(?:(?=.*[A-Z])(?=.*[\d\W])|(?=.*\W)(?=.*\d))|(?=.*\W)(?=.*[A-Z])(?=.*\d)).{8,}(?:(?=.*[a-z])(?:(?=.*[A-Z])(?=.*[\d\W])|(?=.*\W)(?=.*\d))|(?=.*\W)(?=.*[A-Z])(?=.*\d)).{8,}(?:(?=.*[a-z])(?:(?=.*[A-Z])(?=.*[\d\W])|(?=.*\W)(?=.*\d))|(?=.*\W)(?=.*[A-Z])(?=.*\d)).{8,}(?:(?=.*[a-z])(?:(?=.*[A-Z])(?=.*[\d\W])|(?=.*\W)(?=.*\d))|(?=.*\W)(?=.*[A-Z])(?=.*\d)).{8,}(?:(?=.*[a-z])(?:(?=.*[A-Z])(?=.*[\d\W])|(?=.*\W)(?=.*\d))|(?=.*\W)(?=.*[A-Z])(?=.*\d)).{8,}(?:(?=.*[a-z])(?:(?=.*[A-Z])(?=.*[\d\W])|(?=.*\W)(?=.*\d))|(?=.*\W)(?=.*[A-Z])(?=.*\d)).{8,}(?:(?=.*[a-z])(?:(?=.*[A-Z])(?=.*[\d\W])|(?=.*\W)(?=.*\d))|(?=.*\W)(?=.*[A-Z])(?=.*\d)).{8,}(?:(?=.*[a-z])(?:(?=.*[A-Z])(?=.*[\d\W])|(?=.*\W)(?=.*\d))|(?=.*\W)(?=.*[A-Z])(?=.*\d)).{8,}(?:(?=.*[a-z])(?:(?=.*[A-Z])(?=.*[\d\W])|(?=.*
@nataliefl
nataliefl / gist:e2c45621022b794bd69649cbe1517c57
Created November 5, 2016 14:14
Debug ENOENT errors from spawned processes in node
(function() {
var childProcess = require("child_process");
var oldSpawn = childProcess.spawn;
function mySpawn() {
console.log('spawn called');
console.log(arguments);
var result = oldSpawn.apply(this, arguments);
return result;
}
childProcess.spawn = mySpawn;
@nataliefl
nataliefl / changedir
Created July 14, 2016 14:26
Script snippet to quickly navigate many levels up in the folder structure
##
# Go back multiple directories at once.
#
# Example :
#
# shell> .. 5
#
# This will take you 5 directories back in the file structure. This is the same as typing
#
# shell> cd ../../../../..
@nataliefl
nataliefl / logstore
Created April 25, 2016 11:58
Draft of logging lib for comscore maelstrom
'use strict';
var store = {};
module.exports.get = function get() {
var items = {};
Array.prototype.slice.call(arguments)
.filter(function (arg){
return store[arg];
})
/**
* If not equal
* {{#ifnoteq "valueA" "valueB"}} ... {{else}} ... {{/if}}
*/
Handlebars.registerHelper('ifnoteq', function ifnoteq(a, b, opts) {
return (a != b) ? opts.fn(this) : opts.inverse(this);
});