Skip to content

Instantly share code, notes, and snippets.

View joefg's full-sized avatar
🏍️
Carving the corners

joefg

🏍️
Carving the corners
View GitHub Profile
@joefg
joefg / main.py
Created August 18, 2025 18:08
cheapboard - a FastHTML image board in one file
#!/usr/bin/env -S uv run --script
#
# /// script
# requires-python = ">=3.12"
# dependencies = ["python-fasthtml"]
# ///
from datetime import datetime
from fasthtml.common import *
@joefg
joefg / database.py
Created July 16, 2025 20:57
A simple Python SQLite interface including migrations
import glob
import logging
import os
import sqlite3
from contextlib import contextmanager
import config
class Database:
def __init__(self, path=None):
@joefg
joefg / data-wrangling.md
Created July 15, 2025 10:21
Joe's data wrangling guide

Data Wrangling 🤠

How to wrangle data from source to a data product.

Workflow

This is what works for me.

  1. Find the original source. Keep a copy somewhere. My inclination is to keep it in the Git repository if it's small enough, or add it to
@joefg
joefg / tiny-monitor.py
Created June 22, 2025 20:08
tiny-monitor.py
import argparse
import datetime
import json
import os
import urllib.request
DOC = """
<!doctype html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
@joefg
joefg / moongrep
Created June 21, 2025 18:06
Moongrep Standalone
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "einops>=0.8.1",
# "pillow>=11.2.1",
# "pyvips>=3.0.0",
# "torch>=2.7.1",
# "transformers>=4.52.4"
# ]
@joefg
joefg / style.css
Created June 20, 2025 18:47
Clog-iron simple CSS which respects dark mode
body {
color: #444;
font: 16px/1.5 Libre Baskerville, Serif;
margin: 40px auto;
max-width: 650px;
padding: 0 10px;
}
header, footer, nav {
text-align: center;
@joefg
joefg / SJCam-C110+-notes.md
Last active May 24, 2025 22:33
SJCam C110+ Reverse Engineering Notes

SJCam C110+ Notes

TL;DR I want to use this camera without using the app, there are no buttons or screens on the camera itself, and the camera app isn't that great to use. Can I liberate it?

I bought this little action camera to use on my motorbike, and noticed that it creates a WiFi network to handle data transfer. Does it do anything else?

Connection

| SSID | Password |

@joefg
joefg / parliamentary_constituencies.py
Last active March 6, 2025 19:52
UK General Election Results to GeoJSON script
import argparse
import csv
import json
"""
UK General Election Results to GeoJSON script.
Data used:
- <https://commonslibrary.parliament.uk/research-briefings/cbp-10009/>, use the CSV
@joefg
joefg / food_xml_to_geojson.py
Last active December 10, 2024 22:46
UK food hygiene rating XML to GeoJSON converter
import argparse
import json
import xml.etree.ElementTree
"""
UK food hygiene rating API XML to GeoJSON converter.
How to use:
1. Download a food hygiene ratings file for your local authority area
@joefg
joefg / 8080.op
Created July 27, 2015 14:44
A list of all 8080 opcodes. Mirror of Textfiles (http://textfiles.com/programming/8080.op) for posterity
Summary of 8080 Instructions
------- -- ---- ------------
Abbreviations used in this Summary:
R Any of the 8-Bit registers A,B,C,D,E,H,L.
data Any 8-bit or 16-bit value.
PC Program Counter.
SP Stack Pointer.