Single-file version control. Lighter than RCS.
cp rev.rb /usr/local/bin/rev
Requires Ruby, diff and patch. Colored output when git is available.
| """ | |
| 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 |
| filc overhead rough tests: | |
| - mg /usr/share/dict/words | |
| - yolo: 10MB maxrss / 101m insn / 54m cycle | |
| - filc: 30MB maxrss / 370m insn / 176m cycle | |
| - filc/yolo: 3x mem / 3.66x insn | |
| - xzcat optfil-0.674-linux-x86_64.tar.xz >/dev/null | |
| - yolo: 9.7MB maxrss / 40.4bn insn / 32.7bn cycle / 9.42s real / 9.32s user / 0.09s sys | |
| - filc: 33.2MB maxrss / 77.5bn insn / 42.8bn cycle / 12.29s real / 12.16s user / 0.14s sys |
| foo = :untouched | |
| bar = :untouched | |
| [:touched].each do |foo| | |
| bar = :touched | |
| end | |
| foo #=> :untouched | |
| bar #=> :touched |
This is a (necessarily incomplete) list of projects and channels that have decided to permanently move out of Freenode to https://libera.chat (unless stated otherwise). Please reach out below or on IRC if there's additions or corrections.
Sources are mostly comments I've seen on HN, various IRC channels and web searches.
| /* So how does this work? | |
| I'm using ANSI escape sequences to control the behavior of the terminal while | |
| cat is outputting the text. I deliberately place these control sequences inside | |
| comments so the C++ compiler doesn't try to treat them as code.*/ | |
| //[2K[2D[A[2K[A[2K[A[2K[A[2K[A | |
| /*The commands in the fake code comment move the cursor to the left edge and | |
| clear out the line, allowing the fake code to take the place of the real code. | |
| And this explanation uses similar commands to wipe itself out too. */ | |
| //[2K[2D[A[2K[A[2K[A[2K[A | |
| #include <cstdio> |
| package main | |
| import ( | |
| "crypto/sha512" | |
| "encoding/base64" | |
| "fmt" | |
| "log" | |
| "math/rand" | |
| "net/http" | |
| "strings" |
| // Tracking cursor position in real-time without JavaScript | |
| // Demo: https://twitter.com/davywtf/status/1124146339259002881 | |
| package main | |
| import ( | |
| "fmt" | |
| "net/http" | |
| "strings" | |
| ) |