Skip to content

Instantly share code, notes, and snippets.

@tpschmidt
tpschmidt / bootstrap.sh
Created February 28, 2026 11:41
Bootstrap script for OpenClaw on AWS Lightsail with SSM Session Manager, Node.js, AWS CLI, Go, and gogcli
#!/bin/bash
set -eu
# ── SSM agent ────────────────────────────────────────────────────────────────
# We need the SSM agent for accessing Lightsail instances
if ! snap services amazon-ssm-agent | grep -q 'active'; then
snap stop amazon-ssm-agent || true
fi
/snap/amazon-ssm-agent/current/amazon-ssm-agent -register -y \
-id "${ssm_activation_id}" \
@awni
awni / open_code_mlx.md
Last active March 12, 2026 08:30
OpenCode with MLX

The following guide will show you how to connect a local model served with MLX to OpenCode for local coding.

1. Install OpenCode

curl -fsSL https://opencode.ai/install | bash

2. Install mlx-lm

@chriscarrollsmith
chriscarrollsmith / llm-hackathon.md
Created July 5, 2025 13:56
Coders' Colaboratory mini-hackathon on `llm` by simonw

Let's hack on llm!

If you have uv installed (and you should!), you can install llm globally in a uv-managed tool environment with:

uv tool install llm

If you want to use models other than OpenAI models, you'll need some extensions:

@N8python
N8python / pretrain.py
Created January 15, 2025 23:41
Simple character-level pretraining in MLX. Gets a roughly billion tokens/day for an 18M parameter model on one M3 Max.
import json
import random
import mlx.optimizers as optim
import mlx.core as mx
import mlx.nn as nn
import numpy as np
from tqdm import tqdm
import time
from datetime import datetime
@dabeaz
dabeaz / aproducer.py
Created October 17, 2019 17:46
"Build Your Own Async" Workshop - PyCon India - October 14, 2019 - https://www.youtube.com/watch?v=Y4Gt3Xjd7G8
# aproducer.py
#
# Async Producer-consumer problem.
# Challenge: How to implement the same functionality, but no threads.
import time
from collections import deque
import heapq
class Scheduler: