Skip to content

Instantly share code, notes, and snippets.

@amcclosky
amcclosky / statusline.sh
Last active January 18, 2026 16:55
Claude Code statusline script with git info
#!/bin/bash
# Read JSON input from stdin
input=$(cat)
# Extract information from JSON
model_name=$(echo "$input" | jq -r '.model.display_name')
current_dir=$(echo "$input" | jq -r '.workspace.current_dir')
# Extract context window information
@amcclosky
amcclosky / commit.md
Created December 8, 2025 17:30
Claude Commit Command: `/commit ` - .claude/commands/commit.md
description allowed-tools
Commit pending changes with context-aware messages based on conversation
Bash(git status:*), Bash(git diff:*), Bash(git add:*), Bash(git commit:*), Bash(git log:*)

Commit all pending changes on this branch. Follow these steps:

  1. Run git status and git diff to see all pending changes (staged and unstaged)

  2. Analyze the changes and determine if they should be a single commit or split into multiple commits. Split into multiple commits when:

@amcclosky
amcclosky / supabase.md
Last active January 2, 2025 18:57 — forked from kyleledbetter/supabase.md
feat(): supabase schema arch

Supabase Database Architecture

Security & Compliance Requirements

SOC II Compliance

  • All sensitive data must be encrypted at rest
  • Audit logging for all data access and modifications
  • Role-based access control (RBAC) with principle of least privilege
  • Data backup and recovery procedures
  • Regular security assessments and monitoring
@amcclosky
amcclosky / README.md
Last active September 13, 2024 18:13
Script to find the current Magic Number of an MLB Team

Magic Number Script

$ uv run magic.py "Houston Astros"
Reading inline script metadata from: magic.py
The magic number for the Houston Astros is 12.
@amcclosky
amcclosky / deeplinks.md
Last active March 1, 2024 21:58
Backflip Deeplink Tests
@amcclosky
amcclosky / r2.py
Created January 21, 2024 02:15
R2 Compatible boto3 s3 client
import boto3
from botocore.config import Config
from . import config
r2 = boto3.client(
service_name="s3",
endpoint_url=config.R2_S3_ENDPOINT,
aws_access_key_id=config.R2_ACCESS_KEY_ID,
@amcclosky
amcclosky / command-bar.js
Last active November 4, 2021 16:21
useCommandBar - React Hook for next.js
// yarn add commandbar or npm install commandbar --save
import { useEffect } from 'react'
import { init as initCommandBar } from 'commandbar'
const COMMANDBAR_ORG =
process.env.COMMANDBAR_ORG || process.env.NEXT_PUBLIC_COMMANDBAR_ORG
function useCommandBar({ org = COMMANDBAR_ORG, userId, userMeta = {} }) {
@amcclosky
amcclosky / pendulum_type.py
Created January 15, 2021 23:54
A sqlalchemy column type that wraps a Pendulum datetime
# custom sqlalchemy column type for a pendulum datetime - https://pendulum.eustace.io/
from datetime import datetime
import pendulum
import sqlalchemy as sa
from sqlalchemy.types import TypeDecorator as _TypeDecorator
from sqlalchemy_utils.types.scalar_coercible import ScalarCoercible as _ScalarCoercible
@amcclosky
amcclosky / README.md
Created August 10, 2020 16:49
Recover commits

Recover Commits via GitHub API

#til #git #github

curl -u amcclosky:<personal access token> https://api.github.com/repos/amcclosky/baseball/events

curl -u amcclosky:<personal access token> -X POST -d '{"ref":"refs/heads/recover-office-hours", "sha":"d460395af3337bc6b71fd19b154f831ecc6cfa01"}' https://api.github.com/repos/amcclosky/baseball/git/refs

github - How to recover from a git push -force? - Stack Overflow

@amcclosky
amcclosky / README.md
Last active April 15, 2025 16:28
A global roughly time-ordered identifier mixin for sqlalchemy.

A sqlalchemy model mixn, GlobalIdMixin which provides a global roughly time-ordered identifier and an obfuscated version of the global id for public consumption.

Makes use of python-ulid, PL/sql ULID and hashids-python.