Skip to content

Instantly share code, notes, and snippets.

View inchoate's full-sized avatar

Jason Vertrees inchoate

View GitHub Profile
@inchoate
inchoate / statusline.sh
Created May 12, 2026 22:36
Claude Code Status Line
#!/bin/bash
# Claude Code status line — single line, utility-first
input=$(cat)
# ── Extract fields (single jq call for speed) ────────────────────────────────
eval "$(echo "$input" | jq -r '
@sh "MODEL=\(.model.display_name // "?")",
@sh "DIR=\(.workspace.current_dir // "?")",
@sh "DURATION_MS=\(.cost.total_duration_ms // 0)",
@sh "ADDED=\(.cost.total_lines_added // 0)",
@inchoate
inchoate / .tmux.conf
Created March 27, 2026 20:44
My current .tmux.conf
# ╔══════════════════════════════════════════════════════════════════╗
# ║ tmux.conf — Ghostty + Claude Code + Neovim ║
# ║ OSC 52 clipboard · vi copy mode · session persistence ║
# ╚══════════════════════════════════════════════════════════════════╝
# ── Terminal & Color ──────────────────────────────────────────────
# Ghostty supports true color and undercurl natively.
# We set tmux-256color as the base, then add Ghostty-specific
# capabilities: RGB (true color), styled underlines, overlines.
@inchoate
inchoate / logging-best-practices.md
Created January 25, 2026 20:41
Logging Best Practices

Logging Best Practices

A practical guide to structured logging for production services, with emphasis on observability platforms like Datadog, Splunk, and CloudWatch.


1. Log Levels - When to Use Each

CRITICAL  →  System is unusable, wake someone up at 3am
@inchoate
inchoate / ai-workflows:Python-Project-Refactor-Playbook
Created December 10, 2025 15:59
Python B/E Refactoring Playbook
# Python Project Refactor Playbook
A comprehensive guide for refactoring monolithic Python applications (Flask, Django, FastAPI) into maintainable, production-ready codebases.
## 📋 Pre-Refactoring Assessment
### 1. Current State Analysis
```bash
# Analyze codebase structure
find . -name "*.py" -exec wc -l {} + | sort -nr

Frontend Dashboard Refactoring Playbook

Based on the successful refactoring patterns I've seen before, here's a comprehensive playbook for refactoring another frontend. This guide will help another agent execute the same high-quality refactoring.

📋 Pre-Refactoring Checklist

  1. Analyze Current Structure
    - Map out all files in the dashboard directory
@inchoate
inchoate / cycle_stack.sh
Created May 29, 2025 15:53
Shell script to cycle (down, rebuild, up) specific services in a docker compose stack
#!/bin/bash
# cycle_stack.sh - Script to tear down and rebuild Docker Compose services
# Usage: ./cycle_stack.sh [service_name1] [service_name2] ...
set -e # Exit on error
# Check if Docker Compose is installed
if ! command -v docker compose &>/dev/null; then
echo "Error: docker compose is not installed or not in PATH"
@inchoate
inchoate / Makefile.pipsucks
Last active July 8, 2025 19:01
Simple uv wrapper to keep uv-based project dependencies in sync.
# Makefile for managing Python dependencies with uv
#
# I built this because I got tired of juggling uv, pip, pyproject.toml,
# and requirements.txt by hand. This Makefile gives me fast, reproducible
# dependency management without forgetting to freeze, clean, or sync anything.
#
# Were I smarter I'd probably not have to do this. But, alas, I'm not.
#
# Key commands:
#
@inchoate
inchoate / syncwrap.md
Created April 4, 2025 12:16
Syncwrap - small function to wrap your async code to run it safely in a sync context

syncwrap

syncwrap is a light and elegant solution for running asynchronous functions in a synchronous environment. This helper neatly packages your async tasks, handling event loop creation and cleanup so you don’t have to.

Code

import asyncio

def run_async_safely(async_func, *args, **kwargs):
@inchoate
inchoate / download_site.md
Last active October 10, 2024 13:13
Simple Site Downloader
#!/bin/zsh

# Usage:
#     ./download_site.sh {URL}


url=$1
output_dir="./sites"
@inchoate
inchoate / moving-to-fastapi-async.md
Created September 24, 2024 20:15
Moving to FastAPI Async

Moving from Sync to Async in FastAPI with SQLModel? Here's What You Need to Know!

Switching from a synchronous setup to an asynchronous one in your FastAPI/SQLModel app can bring some challenges. When making this switch, several important details need attention, especially around async sessions, avoiding misuse of await, and correctly handling relationships between tables.

A Typical Synchronous Setup:

# sync version
engine = create_engine(database_settings.pg_connection_string)
session = sessionmaker(bind=engine)