Skip to content

Instantly share code, notes, and snippets.

View danvk's full-sized avatar

Dan Vanderkam danvk

View GitHub Profile
@danvk
danvk / keymap-fixed.iiif.json
Created July 29, 2026 11:11
Atlanta, Ga. | 1911 | Vol. 1
{
"id": "https://www.loc.gov/item/sanborn01378_006/manifest.json/generated",
"type": "AnnotationPage",
"@context": [
"http://www.w3.org/ns/anno.jsonld"
],
"label": "Sanborn Fire Insurance Map from Atlanta, Fulton County, Georgia.",
"items": [
{
"id": "https://tile.loc.gov/image-services/iiif/service:gmd:gmd392m:g3924m:g3924am:g3924am_g01378191101:01378_01_1911-0010/georef",
@danvk
danvk / 2026-06-18.iiif.json
Created June 18, 2026 19:09
Chicago IIIF
{
"id": "https://oldinsurancemaps.net/iiif/mosaic/sanborn01790_085/main-content//generated",
"type": "AnnotationPage",
"@context": [
"http://www.w3.org/ns/anno.jsonld"
],
"label": "Mosaic of main content, Chicago, Ill. | 1950 | Vol. 1",
"items": [
{
"id": "https://tile.loc.gov/image-services/iiif/service:gmd:gmd410m:g4104m:g4104cm:g01790195001N:01790_01N_1950-0100W/georef",
@danvk
danvk / oauth_callback_server.py
Created April 7, 2026 19:23
oauth_callback_server.py
#!/usr/bin/env python3
"""Simple localhost server to capture OAuth redirect callbacks."""
from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib.parse import urlparse, parse_qs
PORT = 8080
class OAuthCallbackHandler(BaseHTTPRequestHandler):
@danvk
danvk / brute_force.py
Created February 7, 2025 22:11
Python brute force beats OR-Tools?
import itertools
def w(c0, c1, c2, c3, c4, c5):
a0,e0,i0,o0,u0 = c0
c1,h1,k1,m1,p1,t1 = c1
a2,e2,i2,o2,u2 = c2
l3,n3,r3,s3,y3 = c3
b4,d4,f4,g4,j4,v4,w4,x4,z4 = c4
c5,h5,k5,m5,p5,t5 = c5
n_0=1+d4
@danvk
danvk / 3x3.smt
Created January 24, 2025 20:11
Bound Boggle with Z3
This file has been truncated, but you can view the full file.
(declare-const c0 Bool)
(declare-const h0 Bool)
(declare-const k0 Bool)
(declare-const m0 Bool)
(declare-const p0 Bool)
(declare-const t0 Bool)
(assert (= (+ c0 h0 k0 m0 p0 t0) 1))
(declare-const a1 Bool)
(declare-const e1 Bool)
(declare-const i1 Bool)
@danvk
danvk / gpt_batch_manager.py
Created September 17, 2024 13:38
Python Type Hint Autocomplete repro
#!/usr/bin/env python
"""Manage multiple batches on OpenAI"""
import json
import hashlib
import os
import sys
import time
from typing import Optional, TypedDict, get_type_hints
@danvk
danvk / unlocated-digital-ids.csv
Created August 28, 2024 14:39
Digital IDs that are missing from OldNYC
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
DIGITAL_ID
717743f
2040871
717939f
1516983
1640784
703777f
1629993
1630288
1629362
@danvk
danvk / parser.test.ts
Created December 6, 2023 03:13
Lisp Parser
import { assertEquals } from "https://deno.land/std@0.208.0/assert/mod.ts";
import { parseLisp, tokenize } from "./parser.ts";
Deno.test("tokenizer", () => {
const input = "(first (list 1 (+ 2 3) 9))";
assertEquals(
[...tokenize(input)],
["(", "first", "(", "list", 1, "(", "+", 2, 3, ")", 9, ")", ")"],
);
@danvk
danvk / tsp.geojson
Created June 1, 2023 00:17
An optimal route through the Catskills 3500 High Peaks
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.