Skip to content

Instantly share code, notes, and snippets.

View reishoku's full-sized avatar

reishoku reishoku

  • Tokyo
  • 20:02 (UTC +09:00)
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
@arianvp
arianvp / SSH_MACOS_SECURE_ENCLAVES.md
Last active February 25, 2026 14:19
Native Secure Enclaved backed ssh keys on MacOS

Native Secure Enclave backed ssh keys on MacOS

It turns out that MacOS Tahoe can generate and use secure-enclave backed SSH keys! This replaces projects like https://github.com/maxgoedjen/secretive

There is a shared library /usr/lib/ssh-keychain.dylib that traditionally has been used to add smartcard support to ssh by implementing PKCS11Provider interface. However since recently it also implements SecurityKeyProivder which supports loading keys directly from the secure enclave! SecurityKeyProvider is what is normally used to talk to FIDO2 devices (e.g. libfido2 can be used to talk to your Yubikey). However you can now use it to talk to your Secure Enclave instead!

# Claude Code CLI Environment Variables
# This file lists all environment variables used in v2.1.63 with explanations
## Anthropic API & Authentication
ANTHROPIC_API_KEY - Primary API key for Anthropic's Claude API. Used as fallback when no OAuth token is configured.
ANTHROPIC_AUTH_TOKEN - Alternative bearer token for Anthropic services. Takes priority over ANTHROPIC_API_KEY for authorization headers.
ANTHROPIC_BASE_URL - Custom base URL for Anthropic API endpoints. Overrides the default api.anthropic.com endpoint.
ANTHROPIC_CUSTOM_HEADERS - Custom HTTP headers for API requests. Newline-separated Key: Value pairs.
ANTHROPIC_BETAS - Comma-separated list of beta feature headers to include in API requests. Appended to internal beta flags.
@awni
awni / mlx_distributed_deepseek.md
Last active February 26, 2026 07:32
Run DeepSeek R1 or V3 with MLX Distributed

Setup

On every machine in the cluster install openmpi and mlx-lm:

conda install conda-forge::openmpi
pip install -U mlx-lm

Next download the pipeline parallel run script. Download it to the same path on every machine:

@doraTeX
doraTeX / ocr.sh
Last active January 16, 2026 14:57
A shell script to perform OCR on images/PDFs using macOS built-in OCR engine -- https://doratex.hatenablog.jp/entry/20230629/1687977178
#!/bin/bash
SCRIPTNAME=$(basename "$0")
function realpath () {
f=$@;
if [ -d "$f" ]; then
base="";
dir="$f";
else
base="/$(basename "$f")";
@kconner
kconner / macOS Internals.md
Last active February 20, 2026 23:45
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@sts10
sts10 / rust-command-line-utilities.markdown
Last active February 16, 2026 14:09
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@cielavenir
cielavenir / readme.md
Last active November 14, 2025 05:52
zoom sandbox-exec for macOS
  1. Download Zoom.pkg from https://zoom.us/download
  2. Extract it using https://www.timdoug.com/unpkg/
  3. Now you have Zoom/zoom.us.app
  4. Launch Zoom by zoom.sh Zoom/zoom.us.app/Contents/MacOS/zoom.us

caveats:

  • Zoom will fail to start meeting for the first time. Just launch again.
  • Zoom will tell that crash happened, but you should ignore it.
@dmattera
dmattera / launchctl_man_pages.md
Last active August 22, 2025 16:48
macOS man page entries for launchctl services

This list was auto-generated on macOS 10.15 (Catalina) using a script that did the following:

  1. grabbed the name of all the .plist files located in the 5 folders used by launchctl:
  • ~/Library/LaunchAgents Per-user agents provided by the user.
  • /Library/LaunchAgents Per-user agents provided by the administrator.
  • /Library/LaunchDaemons System wide daemons provided by the administrator.
  • /System/Library/LaunchAgents OS X Per-user agents.
  • /System/Library/LaunchDaemons OS X System wide daemons.
@woachk
woachk / 9p.patch
Created December 11, 2020 17:11
Totally unsupported 9p on Darwin patch (inspired from the Julia Computing patchset circa 2018)
diff --git a/configure b/configure
index 18c26e0389..ceab414c5b 100755
--- a/configure
+++ b/configure
@@ -5754,22 +5754,26 @@ if [ "$eventfd" = "yes" ]; then
fi
if test "$softmmu" = yes ; then
- if test "$linux" = yes; then
- if test "$virtfs" != no && test "$cap_ng" = yes && test "$attr" = yes ; then