Skip to content

Instantly share code, notes, and snippets.

"""
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
@jake-stewart
jake-stewart / color256.md
Last active March 9, 2026 20:31
Terminals should generate the 256-color palette

Terminals should generate the 256-color palette from the user's base16 theme.

If you've spent much time in the terminal, you've probably set a custom base16 theme. They work well. You define a handful of colors in one place and all your programs use them.

The drawback is that 16 colors is limiting. Complex and color-heavy programs struggle with such a small palette.

@dhinakg
dhinakg / serial.md
Created December 15, 2025 18:27
Getting serial on modern Macs

Getting serial on modern Macs

Modern devices default to serial output over DockChannel by default, which is why macvdmtool serial doesn't work. In order to use legacy UART:

On the target device:

  1. Disable SIP
  2. Disable boot-arg filtering
  3. Set the following boot args:
  • serial=3 (or serial=7 or whatever)
@abraithwaite
abraithwaite / chill-zoom.sh
Last active September 8, 2025 18:17
Zoom in Systemd Cgroups on Linux. Change the max allocations to fit your workstation.
#!/usr/bin/bash -xe
cat <<EOF > "${HOME}/.config/systemd/user/zoom.slice"
[Slice]
AllowedCPUs=0-4
MemoryHigh=6G
EOF
cat /usr/share/applications/Zoom.desktop | sed -E 's#^(Exec=).*$#Exec=/usr/bin/systemd-run --user --slice=zoom.slice /opt/zoom/ZoomLauncher#' > "${HOME}/.local/share/applications/Zoom.desktop"
@carlssonk
carlssonk / deploy_node_do.md
Last active January 11, 2025 07:10
Deploy node.js app to DigitalOcean

Deploy Node.js Application to DigitalOcean

This step by step tutorial will show you how to set up a Node.js server with MongoDB to DigitalOcean using PM2, NGINX as reverse proxy and a SSL from LetsEncrypt. We will also add a custom domain name.

Prerequisites

Create Droplet & Generate SSH Key

@IanColdwater
IanColdwater / twittermute.txt
Last active March 8, 2026 00:11
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@femto113
femto113 / generate.c
Last active March 3, 2019 01:29 — forked from munificent/generate.c
A random dungeon generator that (no longer) fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
// 2008-2019
const int H = 40;
const int W = 80;
int m[H][W];
int g(int x)
@noahp
noahp / dell-D6000-dock-ubuntu.md
Last active November 13, 2025 07:37
Dell Universal Dock D6000 on ubuntu
@michaeltreat
michaeltreat / psql_wsl_install.md
Last active May 7, 2024 21:14
Postgres WSL install instructions

Install psql on WSL

Home

This install is pretty different from previous versions of psql install instructions for windows. This install uses the WSL and Ubuntu shell.

We are installing this through the Ubuntu command line which is different from the other Ubuntu install instructions because those instructions use Ubuntu's GUI, which we don't have access to here.

NOTE: Since this is a service that is running on Ubuntu, you should be in the the Ubuntu file system when running these commands!

Install

@gwpl
gwpl / README.txt
Last active October 2, 2021 16:19
systemd.timer example: rsync_userx_to_remotey.sh rsync script example with pidfile and trap for the purpose of https://goo.gl/rzTJD1
Copy&Paste of : https://goo.gl/rzTJD1
self-link (web): https://goo.gl/rzTJD1
self-link (doc): https://goo.gl/kZDBHC
# linux userX -> remotey (only over local network)
Notes from setting rsync systemd.timer .
systemd.timers
references:
https://www.freedesktop.org/software/systemd/man/systemd.timer.html
https://www.freedesktop.org/software/systemd/man/systemd.unit.html