Skip to content

Instantly share code, notes, and snippets.

View njh's full-sized avatar

Nicholas Humfrey njh

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.

@ccaum
ccaum / tasmota humidity sensor rule
Last active March 24, 2024 17:03
This Tasmota rule will automatically turn on the switch if the humidity rises more than 65% and stay on a minimum of 20 minutes.
backlog switchmode 1; poweronstate 0; TelePeriod 10;
Rule1
on tele-SI7021#humidity>60 do backlog RuleTimer1 1200; power 1 endon
on power1#state do RuleTimer1 1200 endon
on Rules#Timer=1 do backlog RuleTimer1 0; power 0 endon
Rule1 1
@pavel-kirienko
pavel-kirienko / arm-bin-to-elf.sh
Last active September 23, 2025 20:55
Converting flat binary into ARM ELF format, useful for firmware uploading via GDB
# The part .data=0x08000000 should be replaced with the correct base offset of the ROM.
# The value 0x08000000 is valid for STM32.
arm-none-eabi-objcopy -I binary -O elf32-little --change-section-address .data=0x08000000 input.bin output.elf
@tuxfight3r
tuxfight3r / heredoc_erb1.rb
Created July 25, 2016 14:56
ruby DATA and __END__ heredoc method
#!/usr/bin/ruby
DATA.each_line do |line|
puts line
end
__END__
Doom
Quake
Diablo
@imjacobclark
imjacobclark / README.md
Created December 13, 2015 17:22
Bare metal Raspberry Pi ACT blink kernel

If you care about your current kernel, move or rename it, don't delete it.

  • Remove old kernel.img from Raspberry Pi
  • Run build.sh
  • Move built kernel.img onto Raspberry Pi
  • Boot, see ACT/OK LED blinking!
@PurpleBooth
PurpleBooth / README-Template.md
Last active June 12, 2026 16:48
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@wholmgren
wholmgren / use-bbdiff
Last active August 11, 2024 22:18
set git difftool to bbdiff
git config --global diff.tool bbdiff
git config --global difftool.bbdiff.cmd 'bbdiff --wait --resume "$LOCAL" "$REMOTE"'
git config --global difftool.prompt false
git config --global merge.tool bbdiff
git config --global mergetool.bbdiff.cmd 'bbdiff --wait --resume "$LOCAL" "$REMOTE"'
Double check ~/.gitconfig
@jpmens
jpmens / mosquitto-dns-srv.diff
Created November 13, 2013 07:48
Add support for DNS SRV records to Mosquitto's mosquitto.py Code placed in the public domain, by Jan-Piet Mens, November 2013
--- mosquitto.py.orig 2013-11-12 11:41:17.000000000 +0100
+++ mosquitto.py 2013-11-13 08:44:31.000000000 +0100
@@ -45,6 +45,11 @@
import sys
import threading
import time
+HAVE_DNS = True
+try:
+ import dns.resolver
+except ImportError:
@willurd
willurd / web-servers.md
Last active June 1, 2026 13:16
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jpmens
jpmens / builder.sh
Created June 5, 2013 17:45
Build Mosquitto 1.2 on OSX Lion
# Build OpenSSL 1.0.1e (or whichever)
$ ./Configure darwin64-x86_64-cc --prefix=/usr/local/stow/openssl-1.0.1e/
$ make install
# Obtain and build Mosquitto
$ hg clone https://bitbucket.org/oojah/mosquitto
$ hg up -r 1.2