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 / 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
@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",