Skip to content

Instantly share code, notes, and snippets.

View HaloWang's full-sized avatar

Ce Wang HaloWang

View GitHub Profile
"""
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
@fanzeyi
fanzeyi / twitter-darkmode.user.js
Last active October 15, 2025 01:51
Twitter Auto Dark Mode
// ==UserScript==
// @name Twitter auto darkmode
// @version 1
// @grant none
// @match *://twitter.com/*
// ==/UserScript==
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', e => {
const isDarkMode = e.matches ? 1 : 0;
document.cookie = `night_mode=${isDarkMode};path=/;domain=.twitter.com;secure`;