Skip to content

Instantly share code, notes, and snippets.

@sys9kdr
sys9kdr / llm-wiki.md
Created August 10, 2026 16:32 — 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.

@sys9kdr
sys9kdr / keyd-default.conf
Created September 28, 2025 05:10
keydでcapslock -> 全角半角、shift + capslock -> capslockに置き換えるコード。xkbはhyprland、swayからもアクセスできるけどうまく設定できなかった。
[ids]
*
[main]
capslock = zenkakuhankaku
# Shift+CapsLockで本来のCapsLock動作
[shift]
capslock = capslock
@sys9kdr
sys9kdr / 折りたたみコンテナoritatami-container.md
Created April 29, 2025 10:26
コンテナ(折りたたみコンテナ)について

折りたたみコンテナの規格っぽいやつについて生成AIに聞いた内容

// 自分が持ってるのは530型

日本の折りたたみコンテナには、事実上の標準規格があります。お買い上げになったコンテナのサイズは、日本で最も広く使われている「530型」または「53型」と呼ばれる規格に該当します。 530型/53型は、外形寸法が概ね530mm×366mm程度で、高さはバリエーションがあります。この規格は日本のさまざまな物流現場で広く採用されているため、異なるメーカーのコンテナでもスタッキング(積み重ね)やネスティング(収納)の互換性が確保されています。 他の主要な規格としては:

600型/60型(約600mm×400mm) 700型/70型(約700mm×440mm)

# なぜかわずかな違いで実行速度が倍違う
この記事では、`old Makefile` と `new Makefile` で生成されたバイナリの実行速度における200%の差について考察します。二つのMakefileにはわずかな違いしかないにも関わらず、最終的に生成される実行ファイルの性能が大きく異なる理由を探ることは、コンパイルオプションやビルドプロセスがパフォーマンスに与える影響について深く考える良い機会です。
## old Makefile の内容と問題点
まず、`old Makefile`を見てみましょう。
```makefile
CFLAGS=-O3 -march=native -mwindows -Wall -Wextra -Werror -flto -fno-exceptions
@sys9kdr
sys9kdr / os-detect-neovim-benchmarks.lua
Last active November 23, 2024 12:21
neovimのos特定の速度のベンチ
-- 測定回数
local iterations = 100000
-- ヘルパー関数で時間を計測
local function measure_time(fn)
local start = vim.uv.hrtime()
for _ = 1, iterations do
fn()
end
local duration = vim.uv.hrtime() - start

nvim-treesitterでどこに何がインストールされているか確認するためにこの辺りを見る。 TSUninsallでアンインストールされないときとかparserの位置を見てreviesionを捨てる。

  • nvim_get_runtime_file('queries/your_lang_name/*.scm', v:true)
  • lua vim.print(vim.api.nvim_get_runtime_file('parser', true))
@sys9kdr
sys9kdr / FindChangeByList.jsx
Created October 28, 2024 09:00 — forked from senki/FindChangeByList.jsx
Slightly modified `FindChangeByList.jsx` for InDesign CS6 - supports multiple List file
//FindChangeByList.jsx
//An InDesign CS6 JavaScript
/*
@@@BUILDINFO@@@ "FindChangeByList.jsx" 3.0.0 15 December 2009
Mod by senki on 2015-06-29
- added dialog with list of files under FindChangeSupport
- and choose between. default is the first
*/
//Loads a series of tab-delimited strings from a text file, then performs a series
//of find/change operations based on the strings read from the file.
#include <stdio.h>
#include <windows.h>
#define IME_CONTROL 0x283
#define IMC_GETOPENSTATUS 0x5
#define IMC_SETOPENSTATUS 0x6
int main(int argc, char** argv) {
HWND fg = GetForegroundWindow();

WSLで(WSLgで?)XDG_RUNTIME_DIRが変になる問題

WSL(でかつWSLgが有効)だとXDG_RUNTIME_DIRがWSLg用の1000で固定されるが、そのディレクトリがそもそも存在しないっぽい。

microsoft/WSL#9689

neovim/neovim#30282

microsoft/WSL#8918

-- 測定回数
local iterations = 100000
-- ヘルパー関数で時間を計測
local function measure_time(fn)
local start = vim.uv.hrtime()
for _ = 1, iterations do
fn()
end
local duration = vim.uv.hrtime() - start