Skip to content

Instantly share code, notes, and snippets.

View do-me's full-sized avatar

Dominik Weckmüller do-me

View GitHub Profile
@do-me
do-me / main.py
Created January 21, 2026 11:50
simple uv template for inline deps for running scripts with uv run main.py
# /// script
# requires-python = ">=3.14"
# dependencies = [
# "pandas",
# "requests",
# "openpyxl"
# ]
# ///
@do-me
do-me / init.sh
Last active January 21, 2026 10:02
Initialize new github repo locally from git repo
gh repo create new_project_name --public --source=. --remote=origin --push
@do-me
do-me / switched.md
Created January 17, 2026 14:44
Switched lat lon for Germany

What does it look like if you switch lat lon for Germany?

@do-me
do-me / index.html
Created January 4, 2026 17:29
supabase guest form
<!doctype html>
<html lang="en" class="bg-slate-50">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Guest List Manager</title>
<!-- 1. Tailwind CSS via CDN -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- 2. Supabase Client via CDN -->
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
@do-me
do-me / convert.py
Created December 30, 2025 16:58
DuckDB spatial convert normal geoparquet to lat lon
import duckdb
con = duckdb.connect()
con.execute("INSTALL spatial; LOAD spatial;")
input_path = '30M_sample_index.parquet'
output_path = '30M_sample_index_with_lat_lon.parquet'
# Use ST_X and ST_Y directly on the 'geometry' column
con.execute(f"""
@do-me
do-me / duckdb_boundary.sh
Last active November 11, 2025 15:20
Filter OSM US Layercake boundary.parquet remotely over DuckDB and export e.g. a region to e.g. a parquet or json file.
#!/usr/bin/env bash
#
# duckdb_boundary.sh — run DuckDB spatial queries by region
#
# Usage:
# ./duckdb_boundary.sh --query "Sicilia" [--format PARQUET|CSV|JSON]
#
# Description:
# - Ensures DuckDB 'spatial' extension is installed and loaded
# - Reads OpenStreetMap boundary data (remote parquet)
@do-me
do-me / extract.sql
Created November 10, 2025 13:02
Extract regional boundaries from osm us layercake with duckdb -ui
COPY (
SELECT *
FROM 'https://data.openstreetmap.us/layercake/boundaries.parquet'
WHERE list_contains("tags"['name'], 'Sicilia')
OR list_contains("tags"['names']['en'], 'Sicily')
) TO 'sicily_boundaries.parquet' (FORMAT 'PARQUET');
@do-me
do-me / script.sh
Created November 10, 2025 09:44
OSM: From .osm.pbf to parquet file with all streets for a region
osmium extract -b 12.2,36.5,15.8,38.8 italy.osm.pbf -o sicily.osm.pbf --overwrite;
osmium tags-filter sicily.osm.pbf w/highway -o sicily_streets.osm.pbf --overwrite;
ogr2ogr -f Parquet -oo PRELUDE_STATEMENTS="INSTALL spatial; LOAD spatial;" \
sicily_streets.parquet sicily_streets.osm.pbf lines;
@do-me
do-me / style.json
Created November 7, 2025 08:09
Mapterhorn 3D DEM + ArcGIS Online World Imagery Map Style
{
"version": 8,
"sources": {
"arcgisonline": {
"type": "raster",
"tiles": [
"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"
],
"tileSize": 256,
"maxzoom": 18,
@do-me
do-me / style.json
Created November 7, 2025 07:32
Maptherhorn Terrain 3D Style
{
"version": 8,
"sources": {
"osm": {
"type": "raster",
"tiles": ["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png"],
"tileSize": 256,
"attribution": "<a href=\"https://www.openstreetmap.org/copyright\">&copy; OpenStreetMap Contributors</a>",
"maxzoom": 19
},