Skip to content

Instantly share code, notes, and snippets.

View wongyouth's full-sized avatar

Ryan Wang wongyouth

View GitHub Profile
@wongyouth
wongyouth / llm-wiki.md
Created June 17, 2026 09:01 — 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.

@wongyouth
wongyouth / colorize.rb
Created June 27, 2025 06:54 — forked from thebinarypenguin/colorize.rb
A simple function to colorize console output of Ruby scripts using ANSI escape codes.
def colorize(value, color)
case color
when :black then "\e[30m" + value.to_s + "\e[0m"
when :red then "\e[31m" + value.to_s + "\e[0m"
when :green then "\e[32m" + value.to_s + "\e[0m"
when :yellow then "\e[33m" + value.to_s + "\e[0m"
when :blue then "\e[34m" + value.to_s + "\e[0m"
when :magenta then "\e[35m" + value.to_s + "\e[0m"
when :cyan then "\e[36m" + value.to_s + "\e[0m"
when :white then "\e[37m" + value.to_s + "\e[0m"
@wongyouth
wongyouth / traefik.yml
Last active June 24, 2019 03:25
Docker Swarm mode with reverse proxy traefik config example
version: '3.3'
services:
reverse-proxy:
image: traefik:v1.7
ports:
- target: 80
published: 80
mode: host
- target: 8080
published: 8080
@wongyouth
wongyouth / install-docker-ce.sh
Last active July 15, 2019 13:33
Install docker-ce into Ubuntu
# install docker-ce on ubuntu
sudo apt-get update && \
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && \
@wongyouth
wongyouth / docker-compose.yml
Last active May 26, 2019 07:04
docker-compose.yml of Jenkins with nginx as reverse proxy
version: '2'
services:
jenkins:
image: jenkinsci/blueocean
user: root
restart: always
volumes:
- jenkins-data:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
- $HOME/jenkins:/home
@wongyouth
wongyouth / format.sh
Created September 27, 2018 16:14
用于 nideshop-mpvue 原生转mpvue用
sed -i '' \
-e 's/that\.data/that/' \
-e 's/this\.data/this/' \
-e 's/that\.setData(/Object.assign(that.$data, /' \
-e 's/this\.setData(/Object.assign(this.$data, /' \
-e 's!//\([^ ]\)!// \1!' \
-e 's/function(/function (/' \
-e 's/^\( *\)\([^ (.]\{1,\}\)(/\1\2 (/' \
-e 's/ == / === /' \
-e 's/ *;? *$//' \
@wongyouth
wongyouth / gist:2390e5e511040cb6a512cb1416773e07
Created August 10, 2018 06:02 — forked from sartak/a.md
Anki 2 annotated schema
-- see https://github.com/ankidroid/Anki-Android/wiki/Database-Structure for a more maintained version of this
-- cards are what you review. easy!
CREATE TABLE cards (
id integer primary key,
-- the epoch milliseconds of when the card was created
nid integer not null,
-- notes.id
did integer not null,
-- deck id (available in col table)
@wongyouth
wongyouth / getQueryParams.js
Created July 26, 2018 03:32
getQueryParams
// https://github.com/nuxt/example-auth0/blob/master/utils/auth.js
const getQueryParams = () => {
const params = {}
window.location.href.replace(/([^(?|#)=&]+)(=([^&]*))?/g, ($0, $1, $2, $3) => {
params[$1] = $3
})
return params
}
{
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
{
// Place your snippets for vue here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",