Skip to content

Instantly share code, notes, and snippets.

View andreagrandi's full-sized avatar
🏠
Working from home... permanently!

Andrea Grandi andreagrandi

🏠
Working from home... permanently!
View GitHub Profile
@andreagrandi
andreagrandi / codex-advisor.md
Created January 20, 2026 22:03
Codex advisor agent for Claude Code (or any similar tool)
name description tools model
codex-advisor
Get a second opinion from Codex AI. Use for architecture reviews, code analysis, alternative approaches, or bouncing ideas off a peer coding agent with different strengths.
Bash, Read, Grep, Glob
sonnet

Codex Advisor

You are a specialized sub-agent that interfaces with the Codex CLI to provide second opinions, alternative perspectives, and peer review from a different AI coding assistant.

@andreagrandi
andreagrandi / statusline-script.sh
Last active January 3, 2026 14:51
Claude Code Status Line Script: displays project info and cost information from ccusage
#!/bin/bash
# Claude Code Status Line Script
# Displays project info and cost information from ccusage
# Read JSON input from stdin
input=$(cat)
# Extract basic information
folder=$(basename "$(echo "$input" | jq -r '.workspace.current_dir')")
@andreagrandi
andreagrandi / git-add-worktree.sh
Created July 13, 2025 12:58
Script to create a git worktree and link existing virtualenv and .envrc files
#!/bin/bash
set -e
# Usage: ./git-add-worktree.sh <base-branch> <new-branch-name>
BASE_BRANCH="$1"
NEW_BRANCH="$2"
WORKTREE_PATH="../my-project-worktrees/$NEW_BRANCH"
# Create the worktree and new branch from base
git worktree add -b "$NEW_BRANCH" "$WORKTREE_PATH" "$BASE_BRANCH"
@andreagrandi
andreagrandi / settings.json
Created July 12, 2025 14:14
Claude Code notifications hooks
...
"hooks": {
"Notification": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "terminal-notifier -title \"🔔 Claude Code\" -message \"Claude needs your input\""
}
from fastapi import HTTPException
from fastapi.responses import JSONResponse
from cadwyn import Cadwyn, HeadVersion, Version, VersionBundle, VersionedAPIRouter
from fastapi.testclient import TestClient
GENERIC_ERROR_CODE = "generic_error"
class CustomHTTPException(HTTPException):
error_code: str | None = None
from fastapi import FastAPI, HTTPException
from fastapi.responses import JSONResponse
from fastapi.testclient import TestClient
GENERIC_ERROR_CODE = "generic_error"
class CustomHTTPException(HTTPException):
error_code: str | None = None
def __init__(self, detail: str, error_code: str = None):
@andreagrandi
andreagrandi / python-compatibility.py
Created October 8, 2024 15:38
Check Python requirements compatibility
import os
import re
import requests
import argparse
def extract_package_names(file_content):
"""Extract package names from the requirements file content."""
package_names = []
# Regular expression to match package names (excluding the version part)
@andreagrandi
andreagrandi / indie_blogs.md
Last active January 7, 2025 04:54
My curated list of indie blogs

My curated list of indie blogs I follow.

This is a curated list of indie blogs I follow. The majority of them are tech related, but not all of them are 100% technical. I've built this list from scratch, often discovering these blogs from links/articles posted on Mastodon.

If you want to suggest me a new blog to follow, you can leave a comment below (spammers will be blocked and reported).

IF I decide to follow the suggested blog, I will take care of adding it to this list.

@andreagrandi
andreagrandi / curated_list.md
Last active July 10, 2024 11:30
This is a test
#!/bin/bash
# This script is necessary to remove the annotations block from each Markdown file.
# These annotations are being written by iA Writer and are not necessary for the website.
# Define the directory to start searching from. Adjust this to your specific folder.
START_DIR="content"
# Process each Markdown file in the specified directory and its subfolders.
find "$START_DIR" -type f -name "*.md" | while read -r file; do
echo "Processing: $file"