Skip to content

Instantly share code, notes, and snippets.

View afvanwoudenberg's full-sized avatar

Aswin van Woudenberg afvanwoudenberg

View GitHub Profile
@afvanwoudenberg
afvanwoudenberg / wolf-goat-cabbage.sql
Created January 11, 2026 16:35
Solving the 'wolf, goat, and cabbage problem' with SQL (SQLite dialect)
WITH RECURSIVE
moves(mask, move_desc) AS (
VALUES
(1, "Farmer crosses alone"),
(3, "Farmer takes wolf"),
(5, "Farmer takes goat"),
(9, "Farmer takes cabbage")
),
states(i, visual) AS (
SELECT 0, '👨 🐺 🐐 🥬 | 🚣🌊🌊🌊🌊 |'
@afvanwoudenberg
afvanwoudenberg / takuzu.sql
Created January 9, 2026 21:40
A Takuzu/Binary puzzle solver in SQL (SQLite dialect)
WITH RECURSIVE
input(puz) AS (
VALUES ('....00.0....' ||
'1....0....11' ||
'.1......00..' ||
'............' ||
'.00...1.....' ||
'.......0..0.' ||
'.1.11...1...' ||
'0......0....' ||
@afvanwoudenberg
afvanwoudenberg / magic_image_squares.ipynb
Last active June 3, 2025 10:27
Embedding pictures into magic squares
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@afvanwoudenberg
afvanwoudenberg / omrin2ics
Created February 8, 2025 20:36
Get waste collection dates from the Omrin API and convert this into an ics file.
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "requests",
# "rsa",
# "pycryptodome",
# "icalendar",
# ]
@afvanwoudenberg
afvanwoudenberg / phone_prettifier.ipynb
Created July 14, 2024 08:36
Organizing mobile apps using the Chamfer distance metric, hierarchical clustering, and a simulated annealing-based algorithm for finding Hamiltonian paths
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@afvanwoudenberg
afvanwoudenberg / terminal.ipynb
Created February 9, 2024 19:40
Get shell access to the Google Colab runtime on a free Colab plan
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@afvanwoudenberg
afvanwoudenberg / mathematicians_birthdays_calendar.ipynb
Created December 25, 2023 23:03
Web scraping Wikipedia to create a mathematicians’ birthdays calendar
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@afvanwoudenberg
afvanwoudenberg / word_search_clock.ipynb
Created November 26, 2023 19:15
Generating images to turn a digital photo frame into a clock
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@afvanwoudenberg
afvanwoudenberg / soma.ipynb
Created October 19, 2023 20:28
Solving Piet Hein's Soma cube with Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@afvanwoudenberg
afvanwoudenberg / chrome_history.ipynb
Created September 2, 2023 15:46
Analyze Chrome browser history using Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.