Skip to content

Instantly share code, notes, and snippets.

View StuMason's full-sized avatar
🏋️‍♂️
Testing

Stu Mason StuMason

🏋️‍♂️
Testing
View GitHub Profile
@StuMason
StuMason / cdr.md
Created March 24, 2026 19:01
Conversation Decision Record - stick this in your CLAUDE.md and smoke it.

You are creating a commit that includes a Conversation Decision Record (CDR). Follow these steps exactly.

This CDR is likely the ONLY record of what happened and why. There may be no PR, no code review, no human reading the diff before or after this lands. Write accordingly — capture everything, because nothing else will.

Step 1: Gather git context

Run these in parallel:

  • git status (never use -uall)
  • git diff and git diff --staged to see all changes
  • git log --oneline -10 for recent commit style
@StuMason
StuMason / statusline.sh
Created February 25, 2026 13:33
Custom statusline script for Claude Code CLI showing repo name, git branch (with dirty indicator), color-coded context usage, session cost, duration, lines changed, and active model name.
#!/bin/bash
# Read JSON input once
input=$(cat)
# Extract fields
cwd=$(echo "$input" | jq -r '.workspace.current_dir')
ctx_pct=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)
cost=$(echo "$input" | jq -r '.cost.total_cost_usd // 0')
cost_fmt=$(printf '$%.2f' "$cost")
# Tailwind CSS v4 Guide: Key Differences from v3
## Installation
### Using PostCSS (Recommended)
```bash
npm install tailwindcss @tailwindcss/postcss postcss
```
Configure your PostCSS:
@StuMason
StuMason / gist:9e12fd7d726467e1f0889122347cd9c5
Created March 4, 2025 18:13
forge to coolify nixpack.toml
[phases.setup]
nixPkgs = ["...", "python311Packages.supervisor", "php82Extensions.redis"]
[phases.build]
cmds = [
# Create required directories in one command
"mkdir -p /var/log /app/storage/framework/{views,cache,sessions} /app/bootstrap/cache /etc/supervisor/conf.d",
# Set permissions in a single command
"chown -R www-data:www-data /var/log /app/storage /app/bootstrap/cache",
@StuMason
StuMason / gist:b988e3ca426afdd69173a26688de7728
Created March 4, 2025 18:11
forge -> coolify example 1, stuartmason.co.uk
[phases.setup]
nixPkgs = ["...", "python311Packages.supervisor", "php82Extensions.redis"]
[phases.build]
cmds = [
    "mkdir -p /var/log",
    "touch /var/log/nginx-access.log /var/log/nginx-error.log",
    "chown -R www-data:www-data /var/log",
    "chown -R www-data:www-data /app",
    "chmod -R 755 /app",
@StuMason
StuMason / docker-compose.yaml
Created February 14, 2025 10:09
Bolt.diy v0.0.6 Coolify Docker Compose file
version: '3.8'
services:
bolt:
image: bolt.diy:latest
pull_policy: build
platform: linux/arm64
build:
context: https://github.com/stackblitz-labs/bolt.diy.git#v0.0.6
target: bolt-ai-production
dockerfile_inline: |
@StuMason
StuMason / laravel-11-docs-for-llm-context
Created November 4, 2024 20:18
LLMs aren't upto date with the latest Laravel features. This is a condensed version of all new features from Laravel 10 to 11, for LLM Context use (Claude Projects, for example)
LARAVEL 11 - NEW FEATURES AND CHANGES
=== artisan ===
- **Isolatable Commands**: Implement the `Illuminate\Contracts\Console\Isolatable` interface to ensure only one instance of a command runs at a time. An `--isolated` option is added to the command for this purpose.
- **Lock ID**: Customize the atomic lock key by defining an `isolatableId` method in the command class.
- **Lock Expiration Time**: Adjust the expiration time of isolation locks by defining an `isolationLockExpiresAt` method in the command class.
- **Prompts for Missing Input**: Implement the `PromptsForMissingInput` interface to automatically prompt users for required arguments that are missing.
- **Custom Prompt Questions**: Use the `promptForMissingArgumentsUsing` method to customize questions for missing arguments.
- **After Prompting for Missing Arguments**: Implement the `afterPromptingForMissingArguments` method to handle additional input prompts after missing arguments are gathered.
<?php
namespace App\Aws;
use Aws\Credentials\CredentialProvider;
use Aws\Credentials\Credentials;
use Aws\Signature\SignatureV4;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Client;
use Illuminate\Support\Facades\App;
@StuMason
StuMason / aws_mfa.py
Created May 6, 2022 11:04
AWS MFA switching
"""
Switching between accounts where MFA is required can be a little manually intensive.
This script updates a temporary profile with a key, secret and session token (using a more stable profile - in this case 'default').
You can then use this temporary profile to switch between accounts.
i.e I have my main profile
I created a `[mfa_temp_session]` profile in my credentials which looked like this:
@StuMason
StuMason / History|2ade281f|563H.json
Last active October 31, 2022 14:32
Visual Studio Code Settings Sync Gist
{
"python.testing.unittestArgs": [
"-v",
"-s",
".",
"-p",
"test_*.py"
],
"python.testing.pytestEnabled": false,
"python.testing.nosetestsEnabled": false,