Skip to content

Instantly share code, notes, and snippets.

View thomashartm's full-sized avatar

Thomas Hartmann thomashartm

View GitHub Profile
@thomashartm
thomashartm / wt
Created January 20, 2026 12:02
Git Worktree Manager - A simple CLI to create and manage git worktrees
#!/usr/bin/env bash
set -euo pipefail
# wt - Git Worktree Manager
# A simple CLI to create and manage git worktrees
readonly SCRIPT_NAME="wt"
readonly VERSION="1.0.0"
# Colors for output
@thomashartm
thomashartm / GUNGAN-Bug-Bug-Binks-CLAUDE.md
Created January 11, 2026 08:47
Gungan Style Personality settings for claude code - transform claude into Bug Bug Binks nerdy software engineering cousin of Jar Jar Binks. Just add it to your CLAUDE.md file

Personality: Bug Bug Binks

Yousa are Bug Bug Binks, da nerdy software engineering cousin of Jar Jar Binks. Meesa was banished from da Gungan tribe until meesa codebase passes all da tests and reviews.

Speak in Gungan dialect: "meesa", "yousa", "da", "muy muy", "okie day". Stay technically accurate but express everything in Gungan speech patterns.

Examples:

  • "Meesa finding da null pointer in yousa function!"
  • "Okie day, da deployment pipeline muy muy broken."
  • "Yousa forgetting da error handling again!"
@thomashartm
thomashartm / CLAUDE.md
Created January 10, 2026 12:45
CLAUDE.md file which makes claude code act a bit more reasonable and senior.

Hard Rules

  • NEVER start writing code without first presenting a plan
  • NEVER proceed past planning without explicit user approval (e.g., "go", "proceed", "yes")
  • Always ask clarifying questions when requirements are ambiguous
  • State assumptions explicitly before acting on them
  • For destructive changes (deletions, infrastructure modifications), always confirm first

Workflow

@thomashartm
thomashartm / openspec-101.md
Created October 31, 2025 08:58
Spec driven development 101 with openspec

Openspec 101

Init your project

cd <project-directory>
openspec init

The instruct your agent to create an AGENTS.md inside your openspec directory.

@thomashartm
thomashartm / buildx-docker-colima.md
Last active September 11, 2025 08:21
Set up buildx with Colima and Docker Engine on MacOS

Set up buildx with Colima and Docker Engine on MacOS

This guide configures Colima’s Docker context to use Buildx as the default builder

Requirements

  • macOS 12+ (Apple Silicon or Intel)
  • Colima installed via Homebrew
  • Docker CLI
  • Docker Buildx

Installation

@thomashartm
thomashartm / android-to-mac.md
Created September 6, 2025 10:21
Recovering all files from an old Android Phone to macOS using ADB

📱 Extracting Files from an Old Android Phone to macOS using ADB

Connecting an approximately 10-year-old Android phone (likely Android 4–6) to a MacBook is tricky, because Google has barely maintained the official Android File Transfer (AFT) app for years and older devices often only support MTP (Media Transfer Protocol).

This guide explains how to copy all accessible files from an older Android device to a Mac using ADB (Android Debug Bridge).
It works even if your device is 10+ years old, as long as you can enable USB debugging.

1. Prepare the Android Device

@thomashartm
thomashartm / clone-terragrunt-stack.sh
Created June 16, 2025 15:27
Clones a terragrunt and or a terraform stack to support the case where we need to clone stacks for different environments in terragrunt. Removes the state directories.
#!/bin/bash
# Check if the correct number of arguments is provided
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <source_directory> <target_directory>"
exit 1
fi
SOURCE_DIR=$1
TARGET_DIR=$2
@thomashartm
thomashartm / create-env.sh
Last active June 20, 2024 12:55
Output environment variables based on AWS SSM params and write .env files. This might be helpful when relying on centrally managed environments variables for local development or CICD
#!/bin/bash
set -e
# Enable -x only for debug purposes
#set -x
# Retrieves a JSON parameter from SSM and output them as key/values
# ./create-env.sh -p <system manager param name>
# Write the output to .env.local
# ./create-env.sh -p <system manager param name> > .env.local
@thomashartm
thomashartm / remove-terragrunt-state.sh
Last active June 19, 2024 08:47
Removes a terragrunt state for a group of resources that contain the provided argument
#!/bin/bash
# usage:
# ./remove-terragrunt-state module.s3_bucket ../../../
TOKEN=$1
SOURCE=$2
terragrunt state rm $(terragrunt state list --terragrunt-source ../../../ | grep $TOKEN) --terragrunt-source $SOURCE
@thomashartm
thomashartm / test-with-false-jwt-claims.py
Last active January 12, 2023 14:04
Testing script for sending manipulated parameters to an OpenIdConnect Endpoint.
import requests
import json
# Konfiguration
client_id = "your_client_id"
client_secret = "your_client_secret"
issuer = "https://your_issuer.com"
redirect_uri = "https://your_redirect_uri.com"
# Anmelde-Anfrage