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 / 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
},
@do-me
do-me / style.json
Last active November 5, 2025 08:20
Maptherhorn Style
{
"version": 8,
"sources": {
"hillshadeSource": {
"type": "raster-dem",
"tiles": ["https://tiles.mapterhorn.com/{z}/{x}/{y}.webp"],
"encoding": "terrarium",
"tileSize": 512,
"attribution": "<a href=\"https://mapterhorn.com/attribution\">© Mapterhorn</a>"
}
@do-me
do-me / extract.sh
Last active October 30, 2025 14:54
Extract Bundesländer polygons from germany-latest.osm.pbf to bundeslaender.parquet fast with osmium and ogr2ogr
osmium tags-filter germany-latest.osm.pbf r/boundary=administrative -o temp_boundaries.osm.pbf --overwrite
osmium tags-filter temp_boundaries.osm.pbf r/admin_level=4 -o bundeslaender.osm.pbf --overwrite
time ogr2ogr -f Parquet bundeslaender.parquet bundeslaender.osm.pbf multipolygons
@do-me
do-me / benchmark.py
Created October 21, 2025 12:04
Benchmark for Mac M3 Max 128Gb and mlx-community/gemma-3-270m-it-4bit with mlx-lm
from mlx_lm import batch_generate, load
model, tokenizer = load("mlx-community/gemma-3-270m-it-4bit")
# load a pandas df here, df has a text column
import pandas as pd
df = pd.read_parquet("2000_benchmark_texts_BAAI.parquet")
# Apply the chat template and encode to tokens
prompts = [i + "--------\nSummarize this article in one sentence" for i in df.text.to_list()]
prompts = [
@do-me
do-me / copygit.sh
Created October 9, 2025 09:19
A shell scirpt cloning a github repo, running yek to copy all text files to clipboard, then deleting the repo for easy pasting in Gemini or other long context models
#!/bin/bash
# Usage: clone_yek_copy <github_repo_url>
# Description: Clones a GitHub repo, runs `yek | pbcopy`, then deletes the repo.
set -e
# --- 1️⃣ Check for URL argument ---
if [ -z "$1" ]; then
echo "Usage: $0 <github_repo_url>"
exit 1
@do-me
do-me / prompt.py
Last active October 7, 2025 03:42
A single line to try out mlx-community/Qwen3-Next-80B-A3B-Instruct-8bit on MacOS with mlx
import argparse
from mlx_lm import load, generate
# Parse CLI arguments
parser = argparse.ArgumentParser()
parser.add_argument("--prompt", type=str, default="hello", help="Custom prompt text")
parser.add_argument("--max-tokens", type=int, default=1024, help="Maximum number of tokens to generate")
args = parser.parse_args()
# Load model
@do-me
do-me / telegram_scrape.js
Created July 26, 2025 10:29
Telegram chat mining client-side
(async () => {
// --- Configuration ---
const scrollDelay = 2000; // 2 seconds. Increase if your connection is slow.
const maxRetries = 5; // Will stop after 5 consecutive scrolls with no new messages.
// --- Script Logic ---
let allMessages = [];
const messageContainer = document.querySelector('.MessageList.custom-scroll');
const seenMessageIds = new Set();
@do-me
do-me / emoji_favicon.html
Created June 25, 2025 06:36
Emoji as favicon inline html
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2280%22>🌍</text></svg>">
@do-me
do-me / rsync.sh
Created June 24, 2025 06:53
Download large file over ssh with rsync
rsync -avz --progress your_host:/home/disk_image/to_download/large_file.vdi .
# host must look like this in config
Host your_host
HostName yourserver.de
User root
IdentityFile ~/.ssh/[email protected]/ed25519/openssh/id_ed25519