Skip to content

Instantly share code, notes, and snippets.

View warmchang's full-sized avatar
🎯
👨‍💻

William Zhang warmchang

🎯
👨‍💻
View GitHub Profile
@warmchang
warmchang / microgpt.py
Created February 12, 2026 17:31 — 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
@warmchang
warmchang / animated_connectors.md
Created August 1, 2025 15:37 — forked from wey-gu/animated_connectors.md
How to create diagrams like Alex Xu/bytebytego's great work

Tool: draw.io

Animate the connectors

Animating your connectors is great for demonstrating directional flow charts, electrical circuits and more. To animate your connectors:

  1. Click on the connector you wish to animate. Hold Ctrl or Cmd and click to select multiple connectors
  2. On the right-hand side go to Style > Property and click on the arrow to expand the field
  3. Scroll down to Flow Animation and check the box
Title: Senior Engineer Task Execution Rule
Applies to: All Tasks
Rule:
You are a senior engineer with deep experience building production-grade AI agents, automations, and workflow systems. Every task you execute must follow this procedure without exception:
1.Clarify Scope First
•Before writing any code, map out exactly how you will approach the task.
•Confirm your interpretation of the objective.
@warmchang
warmchang / contemplative-llms.txt
Created January 12, 2025 11:38 — forked from Maharshi-Pandya/contemplative-llms.txt
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
@warmchang
warmchang / object-count-size.md
Created July 27, 2024 06:00 — forked from dkeightley/object-count-size.md
etcd object counts and sizes

Exec into the etcd container

RKE1

docker exec -it etcd sh

RKE2

@warmchang
warmchang / xz-backdoor.md
Created March 30, 2024 13:19 — forked from thesamesam/xz-backdoor.md
xz-utils backdoor situation

FAQ on the xz-utils backdoor

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that gives developers lossless compression. This package is commonly used for compressing release tarballs, software packages, kernel images, and initramfs images. It is very widely distributed, statistically your average Linux or macOS system will have it installed for

@warmchang
warmchang / sortnumber.c
Created August 2, 2023 15:10 — forked from cloudwu/sortnumber.c
sort telephone number
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <stdio.h>
#define N (100000063/64)
struct bitset {
uint64_t bits[N];

基于TiDB适配KubeBrain实现K8s元信息存储

仓库地址:

项目介绍

基于TiDB适配现有项目KubeBrain,实现K8s所使用的元信息存储API。

背景&动机

当前K8s仅支持etcd作为元信息存储系统,因此部署Kubernetes集群总是需要额外的维护一套etcd集群,etcd集群并不支持水平扩容,随着数据量和读写请求量的增长,容易达到瓶颈。我们实现了轻量级K8s元信息存储项目KubeBrain对存储引擎API进行抽象,希望可以通过适配不同的分布式存储系统,从而可以充分利用已有的存储系统作为基础设施来部署K8s集群支持一定程度的元信息存储的水平扩容,打通K8s和其他存储系统之间的壁垒。 arch