Skip to content

Instantly share code, notes, and snippets.

View JnyJny's full-sized avatar
👽
👽

Erik OShaughnessy JnyJny

👽
👽
View GitHub Profile
@JnyJny
JnyJny / llm-wiki.md
Created April 7, 2026 16:30 — 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.

@JnyJny
JnyJny / parse_thing_thing.py
Created June 26, 2025 23:26
Parse a git commit log and return a tuple of YYYY-MM for least activity and most activity.
import re
from collections import Counter
from datetime import datetime
import dateutil
key_fmt = "{d.year}-{d.month:02d}"
def parse_log(path: str, target_year: int = 0) -> tuple[str, str]:
@JnyJny
JnyJny / remember.py
Last active May 26, 2025 20:25
A Python Mixin Class that Remembers Instances
from __future__ import annotations
import gc
import sys
import weakref
class InstancesMixin:
def __new__(cls, *args, **kwargs) -> Class:
instance = super().__new__(cls)
@JnyJny
JnyJny / find_imports.py
Last active July 27, 2023 08:46
Find Python Import Statements
"""Find import and import from statements
"""
import ast
from pathlib import Path
class ImportRecord:
@classmethod
def toplevel_imports(cls, root: Path, prune: list[str] = None) -> list[str]:
@JnyJny
JnyJny / example.py
Created August 30, 2021 22:16
PDM Classes 101
""" short module description goes here.
Longer module description goes here.
"""
from typing import List, Union
__author__ = "[email protected]"
@JnyJny
JnyJny / book_thing.py
Created July 15, 2021 22:10
Playing with Google Books API
#!/usr/bin/env python3
""" a quick and dirty books query thing
"""
from pprint import pprint
import requests
@JnyJny
JnyJny / reversed_numbers_sum.py
Created July 3, 2021 16:48
Which list of numbers is bigger?
#!/usr/bin/env python3
from string import digits
from typing import List, Tuple
def make_number_lists(base: str = None) -> Tuple[List[str], List[str]]:
base = base or digits[1:]
@JnyJny
JnyJny / panic-full-2021-05-19-163012.0003.ips
Created May 19, 2021 16:42
MacOS Panic, python3, hidapi, write
This file has been truncated, but you can view the full file.
{"caused_by":"macos","macos_version":"Mac OS X 11.3.1 (20E241)","os_version":"Bridge OS 5.3 (18P4556)","macos_system_state":"running","incident_id":"5D23D70E-B825-42B6-AA03-135B7361F5C4","timestamp":"2021-05-19 16:30:12.00 +0000","bug_type":"210"}
{
"binaryImages" : [
[
"3fa744a7-0f34-36da-aa6d-f6503a3176ed",
18446744005107531776,
"K"
],
[
"00000000-0000-0000-0000-000000000000",
import hid
d = hid.device()
d.open(0x2c0d, 1)
@JnyJny
JnyJny / Makefile
Last active March 18, 2020 13:42
Generate HTML, PDF, EPUB and MOBI from ASCIIDoctor Source
# Makefile - Generate HTML, PDF, EPUB, MOBI from ASC
# This is how you assign a string to a variable name in 'make'. The
# variable name doesn't have to be all caps and the equal doesn't have
# to be snugged up to the variable name; it's just how I write
# Makefiles
FILENAME= the_document
# $(IDENTIFIER) is how you reference a 'make' variable, you can use