Skip to content

Instantly share code, notes, and snippets.

@chrisdone
chrisdone / microgpt.py
Created February 13, 2026 22:25 — 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
@chrisdone
chrisdone / _FP reading lists.md
Created January 15, 2026 20:31 — forked from danidiaz/_FP reading lists.md
assorted reading lists

A series of reading lists mostly related to functional programming.

data Todo = Todo {
id :: Text,
created :: UTCTime,
title :: Text,
description :: Text,
priority :: Int
}
data Command
= Add Main.Todo
@chrisdone
chrisdone / gist:02e165a0004be33734ac2334f215380e
Last active November 19, 2025 21:19
Build and run minimal Linux / Busybox systems in Qemu

Common

export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS

Linux kernel

@chrisdone
chrisdone / AnIntro.md
Last active October 11, 2025 13:03
Statically Typed Lisp

Basic unit type:

λ> replTy "()"
() :: ()

Basic functions:

@chrisdone
chrisdone / laws.md
Last active September 23, 2025 20:45 — forked from chrisdone-artificial/laws.md
laws

Laws that apply to our industry (and others) are interesting to me, and I'm writing up here the ones that often come to mind. I usually forget the name, so writing them up might be helpful for remembering in future.

Parkinson's law

C. Northcote Parkinson's law: Work expands so as to fill the time available for its completion. Similarly, in computing, data expands to fill the space available for storage,

@chrisdone
chrisdone / typing.md
Last active August 14, 2025 17:50
Typing Haskell in Haskell

Typing Haskell in Haskell

MARK P. JONES

Pacific Software Research Center

Department of Computer Science and Engineering

Oregon Graduate Institute of Science and Technology

@chrisdone
chrisdone / DBAPI.hs
Last active August 12, 2025 12:59
Defaulting fields in a record in Haskell
{-# LANGUAGE DataKinds #-}
-- | My database API.
module DBAPI where
import Data.Defaults
data ConnSpec p = ConnSpec
{ username :: !(Required p String)
@chrisdone
chrisdone / Apple.md
Last active March 1, 2025 02:14
Apple

Sample types:

isDigit :: Monad f => Char -> f Bool
any :: Monad f => (a -> f Bool) -> [a] -> f Bool
reverse :: Monad f => [a] -> f [a]
map :: Monad f => (a -> f b) -> [a] -> f [b]
"hello" :: Monad f => f String
putStrLn :: (MonadIO f) => String -> f ()
show :: (Show a,Monad f) => a -> f String
@chrisdone
chrisdone / example.hs
Created January 20, 2025 16:26
example.hs
*** Exception: Couldn't resolve constraint
<record getter>
due to problem
missing field for field access
arising from record-error.hell:2:24