Skip to content

Instantly share code, notes, and snippets.

View tobiashochguertel's full-sized avatar
👋

Tobias Hochgürtel tobiashochguertel

👋
View GitHub Profile
@tobiashochguertel
tobiashochguertel / schema-driven-models.py
Created May 21, 2026 12:24
Build Pydantic models dynamically from YAML schema — extends, cross-references, field descriptions, two-pass resolution. Production learnings from resource-catalog CLI.
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "pydantic>=2.0",
# "pyyaml>=6.0",
# ]
# ///
"""
schema-driven-models.py
@tobiashochguertel
tobiashochguertel / typer-output-renderer.py
Last active May 21, 2026 10:23
Reusable OutputRenderer for Typer CLIs — human/json/jsonl/yaml output via --format flag
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "typer>=0.15",
# "rich>=13.0",
# "pyyaml>=6.0",
# "pydantic>=2.0",
# ]
# ///
@tobiashochguertel
tobiashochguertel / config-discover.py
Created May 21, 2026 07:05
Find config files by walking up parent directories (git-style discovery) with customizable path variant matrix
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "pydantic>=2.0",
# ]
# ///
"""
config-discover.py
@tobiashochguertel
tobiashochguertel / path-discovery.py
Last active May 21, 2026 07:03
Generate config file path variants with customizable discovery matrix (dot-prefix, extensions, subdirectories)
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "typer>=0.15",
# "pydantic>=2.0",
# ]
# ///
"""
path-discovery.py
@tobiashochguertel
tobiashochguertel / greet-helper.py
Created May 8, 2026 08:41
PEP 723 greet helper for remote import example
#!/usr/bin/env -S uv run -- uvsr
# /// script
# dependencies = ["rich"]
# ///
"""Greeting helper — can be imported from other PEP 723 scripts."""
def greet(name: str) -> str:
return f"Hello, [bold green]{name}[/bold green]!"
@tobiashochguertel
tobiashochguertel / #ide-settings-mgmt-GistSummary
Last active April 29, 2026 15:15
ide-setup: Multi-developer IDE settings management tool with chezmoi, lefthook, and Taskfile integration
# ide-settings-mgmt
Multi-developer IDE settings management tool
A PEP 723 uv inline Python script for managing IDE settings with:
• Per-developer profiles stored in ~/.ide-settings-mgmt/ with chezmoi
• Repository initialization with .ide-settings-mgmt/ structure
• Lefthook integration for git hooks automation
• Taskfile integration for IDE management tasks
• Support for VS Code, JetBrains, and NeoVim
@tobiashochguertel
tobiashochguertel / #playwright-visibility-debug-GistSummary
Last active April 28, 2026 18:48
Reusable Playwright visibility debug utility with CLI screenshots and occlusion diagnostics
# playwright-visibility-debug
Playwright visibility diagnostics CLI
Bun-first TypeScript CLI for debugging UI visibility with:
• DOM presence, viewport, style, and occlusion analysis
• Multi-match selector handling with best-candidate selection
• JSON reports, screenshots, presets, and Taskfile integration
Install: curl -fsSL https://gist.githubusercontent.com/tobiashochguertel/bf7bc60f8946c7ecbe0d14782b4a8c99/raw/install.sh | bash
@tobiashochguertel
tobiashochguertel / #git-submodule-manager-GistSummary
Last active April 17, 2026 14:19
git-submodule-manager: Comprehensive Git Submodule Management Tool - PEP 723 uv inline script with rich output and workflow automation
# git-submodule-manager
Comprehensive Git Submodule Management Tool
A PEP 723 uv inline Python script for managing git submodules with:
• Rich terminal output with tables and colors
• Status checking, workflow automation, JSON output
• Automated pull/push workflows with correct order
Install: curl -fsSL https://gist.github.com/tobiashochguertel/e07a0a79b3ce8e7d157405d6845e473e/raw/install.sh | bash
@tobiashochguertel
tobiashochguertel / #task-help-GistSummary
Last active April 17, 2026 14:19
task-help: pretty-print Taskfile tasks grouped by namespace with ANSI colours (PEP 723 uv inline script)
# task-help
Pretty-Print Taskfile Tasks with Rich Grouped Output
A PEP 723 uv inline Python script that displays Taskfile tasks grouped by
namespace with ANSI colors, emoji headers, and customizable configuration.
Install: curl -fsSL https://gist.github.com/tobiashochguertel/261c54d64fff6dc1493619e2924161b4/raw/install.sh | bash
@tobiashochguertel
tobiashochguertel / jqlog.sh
Created February 22, 2026 09:48 — forked from panzi/jqlog.sh
Follow JSON logs formatted using jq. You can also pass jq options after the filename for filtering.
#!/usr/bin/bash
set -eo pipefail
RED=$(echo -e '\033[0;1;31m')
NORMAL=$(echo -e '\033[0m')
if [[ $# -lt 1 ]]; then
echo "usage: $0 <logfile> [jq-options...]">&2
exit 1
fi
logfile=$1
shift