Skip to content

Instantly share code, notes, and snippets.

@myd7349
myd7349 / llm-wiki.md
Created June 15, 2026 02:45 — 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.

import pyglet
player = pyglet.media.Player()
source = pyglet.media.StreamingSource()
media = pyglet.media.load('example-video.mp4')
player.queue(media)
player.play()
window = pyglet.window.Window()
while player.source and player.source.video_format:
pyglet.clock.tick(poll=True)
window.clear()
@myd7349
myd7349 / fwd_opt.py
Created May 30, 2026 07:51 — forked from larsoner/fwd_opt.py
See how we can speed up dipole fitting
import numpy as np
import mne
import time
data_path = mne.datasets.sample.data_path()
subjects_dir = data_path / 'subjects'
n_dips = 10
radius = 0.05
rr = np.random.default_rng(0).normal(size=(n_dips, 3))
rr /= np.linalg.norm(rr, axis=1)[:, np.newaxis] / radius * 0.9
% Create fsaverage_1020
headshape = ft_read_headshape('~/mne_data/MNE-sample-data/subjects/fsaverage/bem/outer_skin.surf');
% [pos, tri, magic] = read_surf('~/mne_data/MNE-sample-data/subjects/fsaverage/surf/lh.seghead');
% headshape = [];
% headshape.pos = pos;
% headshape.tri = tri;
%ft_plot_mesh(headshape,'facecolor','skin');camlight;
@myd7349
myd7349 / print-pdf-in-python.md
Created May 19, 2026 01:22 — forked from aspose-com-gists/print-pdf-in-python.md
Print PDF File in Python | Print PDF to Printer | Printing PDFs
@myd7349
myd7349 / LICENSE.txt
Created April 20, 2026 01:17 — forked from endolith/LICENSE.txt
Python implementation of "Cookbook formulae for audio EQ biquad filter coefficients"
MIT License
Copyright (c) 2013 endolith
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@myd7349
myd7349 / AsynCommand.cs
Created April 7, 2026 09:03 — forked from martinskuta/AsynCommand.cs
Implementation of AsyncCommand for WPF
#region Usings
using System;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows.Input;
#endregion
namespace AsyncCommandGist
@myd7349
myd7349 / speedada.cpp
Created January 27, 2026 05:51 — forked from bagder/speedada.cpp
measure ada URL parsing the same way speedparse does
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
#include <stdio.h>
#include <stdlib.h>
#include <poll.h>
#include <uv.h>
static void on_close(uv_handle_t* handle);
static void on_connect(uv_connect_t* req, int status);
static void on_write(uv_write_t* req, int status);
static void on_alloc(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf)
@myd7349
myd7349 / http_client_get.cc
Created January 27, 2026 05:47 — forked from AhnMo/http_client_get.cc
Wininet HTTP Client Example
#include <windows.h>
#include <wininet.h>
#include <stdio.h>
#pragma comment (lib, "Wininet.lib")
int main(int argc, char *argv[]) {
HINTERNET hSession = InternetOpen(
L"Mozilla/5.0", // User-Agent