Skip to content

Instantly share code, notes, and snippets.

View atom2ueki's full-sized avatar
☮️

Tony Li atom2ueki

☮️
View GitHub Profile
@atom2ueki
atom2ueki / llm-wiki.md
Created April 13, 2026 07:55 — 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.

@atom2ueki
atom2ueki / microgpt.py
Created April 13, 2026 07:54 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and run inference for 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
import UIKit
protocol CommonProtocol {
func commonFunc()
}
protocol ProtocolA: CommonProtocol {
func sameName()
}
@atom2ueki
atom2ueki / gist:0f2f8b8ba6f0413f523a324d71a50604
Created May 30, 2019 09:05 — forked from jwebcat/gist:5122366
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
@atom2ueki
atom2ueki / accelerate.m
Last active February 18, 2019 07:20
form an array of sqrt of float numbers from another float array by using accelerate vs forloop way
#import <Foundation/Foundation.h>
#import <Accelerate/Accelerate.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSLog(@"start");
int count = 10000000;
float *x = malloc(count * sizeof(float));
float initial = 0;
float increment = drand48()*count;
@atom2ueki
atom2ueki / ViewController.h
Last active April 12, 2018 08:25
ViewController.h
//
// ViewController.h
// runtime_special_case
//
// Created by tonyli on 4/10/18.
// Copyright © 2018 tonyli. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <objc/runtime.h>
import UIKit
// MARK: - UIButton Related
public extension UIButton {
private struct cs_associatedKeys {
static var accpetEventInterval = "cs_acceptEventInterval"
static var acceptEventTime = "cs_acceptEventTime"
}
// 重复点击的间隔
var cs_accpetEventInterval: NSTimeInterval {
get {
@atom2ueki
atom2ueki / create.sh
Created July 5, 2017 07:26
Create a bootable usb for High Sierra Beta
sudo /Applications/Install\ macOS\ High\ Sierra\ Beta.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ macOS\ High\ Sierra\ Beta.app
@atom2ueki
atom2ueki / multiple-react-drawer-sample.js
Created November 3, 2016 08:10
multiple react-drawer sample
/**
* This is a thrid party component created by Tony Li
*
* all right reserved by @author Tony Li
*
*/
import React from 'react';
import ReactDOM from 'react-dom';
import ReactDrawer from '../src/ReactDrawer';
@atom2ueki
atom2ueki / app.js
Created November 28, 2015 12:56
react-native-router-redux-sample
'use strict';
import React, { Component, StyleSheet } from 'react-native';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux/native';
import {
actions as routerActions,
NavBar,
Route,
Router,