Skip to content

Instantly share code, notes, and snippets.

View bit-cook's full-sized avatar
😆
Life is fantastic!

BitCook bit-cook

😆
Life is fantastic!
View GitHub Profile
@bit-cook
bit-cook / llm-wiki.md
Created April 6, 2026 19:56 — 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.

@bit-cook
bit-cook / microgpt.py
Created February 12, 2026 15:21 — 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
@bit-cook
bit-cook / linearRegression.hhs
Created August 18, 2020 18:12 — forked from lidangzzz/linearRegression.hhs
linearRegression.hhs
class LinearRegression {
w: Mat;
constructor() { }
//x: M-by-N matrix. M data with N dimensions. Each row is an N-dim vector
//y: M-by-1 matrix
fit(x_: Mat, y_: Mat) : LinearRegression{
let y = y_;
if (y_.rows != 1 && y_.cols == 1) {y = y_.T();} //check the dimension of y
var x = x_.resize(x_.rows, x_.cols + 1, 1); //expan x_ with one more column with 1
@bit-cook
bit-cook / v2ray-detect.nse
Created March 8, 2020 09:37 — forked from nickfox-taterli/v2ray-detect.nse
vmess ws 检测脚本(配合nmap)
-- 只扫原生WS,不要太恐慌.
local stdnse = require "stdnse"
local http = require "http"
categories = { "default", "discovery", "safe" }
portrule = function(host, port)
return true
end
import requests
import json
import base64
import sqlite3
import zlib
import time
from datetime import datetime
from gql import gql, Client
from gql.transport.requests import RequestsHTTPTransport
@bit-cook
bit-cook / gdrive_download.md
Created December 18, 2019 14:54 — forked from vladalive/gdrive_download.md
Download Google Drive files from linux terminal via wget

Setup:

  1. Add this code to your ~/.bash_aliases file.
function gdrive_download () {
  CONFIRM=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://docs.google.com/uc?export=download&id=$1" -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')
  wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$CONFIRM&id=$1" -O $2
  rm -rf /tmp/cookies.txt
}
@bit-cook
bit-cook / install_mxnet_p2xlarge.sh
Created February 26, 2019 14:55 — forked from ziyuang/install_mxnet_p2xlarge.sh
Install MXNet (with Anaconda Python 3, CUDA, cuDNN, Intel MKL, OpenCV, Zsh) for p2.xlarge on Ubuntu 16.04 (ami-6f587e1c).
#!/bin/bash
set -e
# Put
# 1. CUDA installation script (cuda_*.run, see https://developer.nvidia.com/cuda-downloads)
# 2. cuDNN archive (cudnn-*.tgz, see https://developer.nvidia.com/rdp/cudnn-download)
# 3. Intel MKL archive (l_mkl_*.tgz, see https://software.intel.com/en-us/intel-mkl)
# under $HOME
# Also set INTEL_MKL_SN to Intel MKL's serial number (XXXX-XXXXXXXX)
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@bit-cook
bit-cook / license sublime text
Created January 20, 2017 16:12
license sublime text
—– BEGIN LICENSE —–
Anthony Sansone
Single User License
EA7E-878563
28B9A648 42B99D8A F2E3E9E0 16DE076E
E218B3DC F3606379 C33C1526 E8B58964
B2CB3F63 BDF901BE D31424D2 082891B5
F7058694 55FA46D8 EFC11878 0868F093
B17CAFE7 63A78881 86B78E38 0F146238
BAE22DBB D4EC71A1 0EC2E701 C7F9C648
@bit-cook
bit-cook / gist-blog.md
Created September 28, 2016 08:47 — forked from kevin-isky/gist-blog.md
Gist 配合 roughdraft.io 写东西

一直都喜欢用markdown记录东西,即使平时用的某云笔记并不支持markdown,也还是习惯保持markdown格式的记录。最近Medium比较火,就试着把之前写好的一篇文章发到Medium上去,结果Medium并不支持Markdown,可是在Medium上写作的Geek们自然有办法:

就是在这里看到了Github的Gist原来可以这么玩,忽然好奇Gist是不是还有其他好玩的玩儿法。一发不可收拾,果然找到了各种花样玩儿法:

总得来说还是对Gist写东西比较感兴趣,有版本控制,能够设置成别人可见或不可见,还支持协作。Gist写好之后可以通过roughdraft.io发布出来,读起来很方便。