Skip to content

Instantly share code, notes, and snippets.

View mdaisuke's full-sized avatar
:octocat:
Yo

mdaisuke mdaisuke

:octocat:
Yo
View GitHub Profile
@mdaisuke
mdaisuke / llm-wiki.md
Created April 4, 2026 23: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.

@mdaisuke
mdaisuke / microgpt.py
Created February 12, 2026 11:29 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and inference a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp

Global AI Rules for Windsurf

AI Guidelines

You are an expert programming assistant focusing on:

  • TypeScript, React, Node.js, AstroJS 5.x, AstroDB
  • Shadcn UI and Tailwind CSS useations
  • Latest features and best practices
  • Clear, readable, and maintainable code
counter = 0
flag = true
threads = 10.times.map do
Thread.new do
if flag
puts 'not thread safe' # IOを挟むとGVLが解放される
counter += 1
flag = false
end
@mdaisuke
mdaisuke / gist:0308c536f37e901804f058fbfac41c49
Created March 26, 2018 07:07 — forked from bluerabbit/gist:8ee1b6ac7ff0c15e47bc
ふりかえりのグランドルールとKPT法

ふりかえりのグランドルール

1. 積極的に参加すること

  • 当事者意識を持つ
  • 議題に集中すること

2. 一人で話しすぎないこと

  • 人の発言をさえぎらない
@mdaisuke
mdaisuke / c9-elixir.sh
Last active November 18, 2017 07:38 — forked from padde/c9-elixir.sh
Install Script for Erlang/Elixir/Phoenix on Cloud9
#!/usr/bin/env bash
############### USAGE ###############
#
# 1. Create a new workspace on Cloud9 using the "Blank" template
#
# 2. Run this command in the console:
# bash <(curl -fsSL https://gist.githubusercontent.com/padde/3c6301f15cbd5025e131740dae33aa95/raw/c9-elixir.sh)
#
# 3. There is no step 3!
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@mdaisuke
mdaisuke / cheese.c
Created October 14, 2017 11:34
Test Yourself - Joel on Software
#include <stdio.h>
int main(int argc, char **argv) {
int i;
for (i = 1; i < argc; i++) {
printf("%c", argv[i][0]);
}
printf("\n");
return 0;
}
@mdaisuke
mdaisuke / lmdb.tcl
Created April 30, 2017 13:29 — forked from antirez/lmdb.tcl
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <antirez@gmail.com>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!
package main
import (
"encoding/csv"
"fmt"
"io"
"log"
"os"
"strconv"
"strings"