Skip to content

Instantly share code, notes, and snippets.

View simonw's full-sized avatar

Simon Willison simonw

View GitHub Profile
@simonw
simonw / index.html
Created October 23, 2025 16:45
Terminal output HTML
<pre style="background: rgb(42, 42, 42); color: rgb(255, 255, 255); padding: 15px; border-radius: 4px;"><span style="color: rgb(255, 255, 255);">&gt; Take a look at this issue and see what you think https://github.com/simonw/datasette/issues/2520 </span>
⏺<span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);"> </span><span style="color: rgb(255, 255, 255); background: rgb(0, 0, 0);">Fetch</span><span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);">(https://github.com/simonw/datasette/issues/2520)</span>
<span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);"> </span>⎿<span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);"> </span> <span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);">Received </span><span style="color: rgb(255, 255, 255); background: rgb(0, 0, 0);">239.1KB</span><span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);"> (200 OK)</span>
⏺<span style="color: rgb(242, 242, 242); background: rgb(0, 0, 0);"> </span><span style
@simonw
simonw / index.html
Created October 23, 2025 03:51
Terminal output HTML
<pre style="background: rgb(0, 0, 0); color: rgb(242, 242, 242); padding: 15px; border-radius: 4px;">
╭───<span style="color: rgb(204, 98, 70);"> Claude Code </span><span style="color: rgb(135, 135, 135);">v2.0.25</span><span style="color: rgb(204, 98, 70);"> </span>──────────────────────────────────────────────────────╮
│<span style="color: rgb(242, 242, 242);"> </span>│<span style="color: rgb(242, 242, 242);"> </span><span style="color: rgb(204, 98, 70);">Tips for getting </span><span style="color: rgb(242, 242, 242);"> </span>│
│<span style="color: rgb(242, 242, 242);"> </span><span style="color: rgb(255, 255, 255);">Welcome back Simon!</span><span style="color: rgb(242, 242, 242);"> </span>│<span style="color: rgb(242, 242, 242);"> </span><span style="color: rgb(204, 98, 70);">started</span><span style="color: rgb(242, 242, 242);"> </span>│
│<span style="color: rgb(242, 242, 242);">
@simonw
simonw / index.html
Created October 22, 2025 23:54
Terminal output HTML
<pre style="background: rgb(0, 0, 0); color: rgb(242, 242, 242); padding: 15px; border-radius: 4px;">
╭───<span style="color: rgb(204, 98, 70);"> Claude Code </span><span style="color: rgb(135, 135, 135);">v2.0.25</span><span style="color: rgb(204, 98, 70);"> </span>──────────────────────────────────────────────────────╮
│<span style="color: rgb(242, 242, 242);"> </span>│<span style="color: rgb(242, 242, 242);"> </span><span style="color: rgb(204, 98, 70);">Tips for getting </span><span style="color: rgb(242, 242, 242);"> </span>│
│<span style="color: rgb(242, 242, 242);"> </span><span style="color: rgb(255, 255, 255);">Welcome back Simon!</span><span style="color: rgb(242, 242, 242);"> </span>│<span style="color: rgb(242, 242, 242);"> </span><span style="color: rgb(204, 98, 70);">started</span><span style="color: rgb(242, 242, 242);"> </span>│
│<span style="color: rgb(242, 242, 242);">
@simonw
simonw / response.json
Created October 22, 2025 23:47
GPT-4o audio response
This file has been truncated, but you can view the full file.
{
"id": "chatcmpl-CTcq3dXrcStnVZibmdqTnUJKljYTv",
"object": "chat.completion",
"created": 1761176843,
"model": "gpt-4o-mini-audio-preview-2024-12-17",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",

gpt5_database_tools

Demo script showing HTTP requests to use tools with reasoning with GPT-5.

OPENAI_API_KEY=$(llm keys get openai) uv run --with rich --with httpx gpt5_database_tools.py
╔═══════════════════════════════════════════════════════════════════════════╗
║ ║
║ 🎓 LLM PRE-TRAINING FROM SCRATCH - COMPLETE JOURNEY ║
║ ║
╚═══════════════════════════════════════════════════════════════════════════╝
═══════════════════════════════════════════════════════════════════════════
WHAT WE ACCOMPLISHED
═══════════════════════════════════════════════════════════════════════════

Datasette Allow Block Matching - Pure SQLite Implementation

Overview

This prototype demonstrates how Datasette's permission checking logic (allow blocks) can be implemented entirely in SQLite using JSON functions, without requiring Python logic for the core matching algorithm.

The Problem

Datasette uses "allow blocks" to control permissions. An allow block is a JSON object that specifies which actors can perform an action:

@simonw
simonw / claude-code-devcontainer.md
Created September 30, 2025 18:33
Docs generated using Claude Code against its own repo

Claude Code Devcontainer

A secure, isolated development environment for Claude Code with network restrictions and pre-configured development tools.

Overview

This devcontainer provides a sandboxed environment for Claude Code with:

  • Network firewall restrictions limiting outbound connections to approved domains
  • Pre-installed development tools (git, gh CLI, zsh, fzf)
  • VS Code extensions (Claude Code, ESLint, Prettier, GitLens)
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "click",
# ]
# ///
import os
import json
import re