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 / 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
@do-me
do-me / JRC_unit_hierarchy.md
Created June 17, 2025 13:55
European Commission Joint Research Centre Unit Hierarchy (as of 06/2025)

Joint Research Centre (JRC) Organizational Table (06/2025)

Workflow

  • Open https://op.europa.eu/en/web/who-is-who/organization/-/organization/JRC
  • Run this code snippet multiple times in the browser console document.querySelectorAll('.op-icon-more').forEach(button => button.click()); (wait between the runs; it clicks all plus icons to expand the underlying info)
  • Either save the page as pdf or if you're an expert, copy the HTML from the DOM
  • Use Gemini to extract the following table with this prompt: Create a table from this information with the following columns: Level 1, Level 2, Level 3, Level 4, Role, Name, Contact, Unit Code

You can do the same for any other EU institution or on higher levels, like the EC adapting just the columns (levels of hierarchy).

@do-me
do-me / extract.js
Created May 5, 2025 10:01
Extracts Trumps ban words from website
// https://pen.org/banned-words-list/ on 5/5/2025
let words = [];
document.querySelectorAll('td').forEach(cell => {
const text = cell.textContent.trim();
if (text) {
words.push(text);
}
});
words.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()));
console.log(words.join('\n'));
@do-me
do-me / maplibre_rectangle.html
Created April 17, 2025 13:58
maplibre custom rectangle drawing logic
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>MapLibre Draw Rectangle</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<!-- MapLibre GL JS -->
<script src='https://unpkg.com/[email protected]/dist/maplibre-gl.js'></script>
<link href='https://unpkg.com/[email protected]/dist/maplibre-gl.css' rel='stylesheet' />
@do-me
do-me / dict_to_json.py
Created March 28, 2025 16:49
Save and load python dict as gzipped json
import json, gzip
def load_json(file_path):
try:
with gzip.open(file_path, 'rt', encoding='utf-8') as f:
return json.load(f)
except OSError: #if the file is not gzipped
with open(file_path, 'r', encoding='utf-8') as f:
return json.load(f)
@do-me
do-me / deck.py
Created March 4, 2025 20:32
Simple pydeck deck.gl Lineplot layer
import pydeck as pdk
df = pd.read_json("https://raw.githubusercontent.com/visgl/deck.gl-data/master/examples/line/heathrow-flights.json")
INITIAL_VIEW_STATE = pdk.ViewState(latitude=47.65, longitude=7, zoom=4.5, max_zoom=16, pitch=50, bearing=0)
line_layer = pdk.Layer(
"LineLayer",
df,
get_source_position="start",
@do-me
do-me / deck.py
Last active March 24, 2025 15:39
Simple pydeck deck.gl Scatterplot layer
import pydeck as pdk
import pandas as pd
import numpy as np
### sample data
import duckdb
import geopandas
df = duckdb.sql(f"SELECT * FROM 'geonames_23_03_2025.parquet' WHERE \"1\" = 'London' \
AND \"8\" = 'GB' ").df()
gdf = geopandas.GeoDataFrame(
@do-me
do-me / extract.sh
Last active March 3, 2025 16:16
Pmtiles extract subset from weekly builds
pmtiles extract https://build.protomaps.com/20250303.pmtiles OUTPUT.pmtiles --region=your_subset.geojson
@do-me
do-me / docling.sh
Created February 11, 2025 15:24
Docling bash script for converting a directory of pdfs to a directory of textfiles and a single LLM-ingestable text file
#!/bin/bash
# Set the input directory (where your PDFs are)
INPUT_DIR="." # Current directory, change if needed
# Set the output file name
OUTPUT_FILE="llm_ready.txt"
# Set the temporary directory
TEMP_DIR="temp_pdf_text"