Skip to content

Instantly share code, notes, and snippets.

View cbroberg's full-sized avatar
💭
Building code

Christian Broberg cbroberg

💭
Building code
View GitHub Profile
@cbroberg
cbroberg / llm-wiki.md
Created May 3, 2026 13:44 — forked from rohitg00/llm-wiki.md
LLM Wiki v2 — extending Karpathy's LLM Wiki pattern with lessons from building agentmemory

LLM Wiki v2

A pattern for building personal knowledge bases using LLMs. Extended with lessons from building agentmemory, a persistent memory engine for AI coding agents.

This builds on Andrej Karpathy's original LLM Wiki idea file. Everything in the original still applies. This document adds what we learned running the pattern in production: what breaks at scale, what's missing, and what separates a wiki that stays useful from one that rots.

What the original gets right

The core insight is correct: stop re-deriving, start compiling. RAG retrieves and forgets. A wiki accumulates and compounds. The three-layer architecture (raw sources, wiki, schema) works. The operations (ingest, query, lint) cover the basics. If you haven't read the original, start there.

@cbroberg
cbroberg / create-key-pair.sh
Created March 6, 2018 19:39 — forked from mince27/create-key-pair.sh
AWS Lightsail Create Key Pair
aws lightsail create-key-pair \
--key-pair-name 'lightsail_demo' \
--query 'privateKeyBase64' \
--output text > 'demo.key'
chmod 700 "demo.key"
@cbroberg
cbroberg / class MouseMover
Last active October 8, 2017 21:29
Render Props and Ensuring Referential Identity
class MouseMover extends Component {
renderMouseMovement = ({ x, y }) => {
return <Text>The mouse position is ({x}, {y})</Text>
}
render() {
return (
<MouseMove render={this.renderMouseMovement} />
)
@cbroberg
cbroberg / toggleswitch.html
Created October 3, 2017 21:58
ToggleSwitch in Vanilla HTML + CSS
<!DOCTYPE html>
<html>
<head>
<style>
.switch {
position: relative;
display: inline-block;
width: 90px;
height: 34px;
}
const rand = Math.random() < 0.5
const throwError = rand // random boolean
// validation, error handling, boolean
let validator = {
set: function(obj, prop, value) {
if (prop === 'age') {
if (!Number.isInteger(value)) {
if (throwError) {
throw new TypeError('The age is not an integer')
@cbroberg
cbroberg / osx-mongodb-rlimits-fix.md
Created March 6, 2017 20:49 — forked from tamitutor/osx-mongodb-rlimits-fix.md
Fix Mongodb "soft rlimits" Warning On Mac OS X (Yosemite)

If you are seeing Mongo soft rlimits warnings in your logs, or a WARNING: soft rlimits too low. Number of files is 256, should be at least 1000 when you login to mongo shell via mongo from the commandline, or any mysterious/unexplained mongo connection errors... follow this how-to exactly and it will resolve the issue for you.

(Source of this how to found at basho/basho_docs#1402)

First file: sudo vi /Library/LaunchDaemons/limit.maxfiles.plist

...containing: