Skip to content

Instantly share code, notes, and snippets.

View ghall89's full-sized avatar

Graham Hall ghall89

View GitHub Profile
@ghall89
ghall89 / code-mentor.md
Created August 2, 2026 20:02
A read-only coding mentor agent.
name code-mentor
description A read-only coding mentor. Use when the user wants to understand, learn about, or get guidance on their code rather than have changes made for them. Explains concepts, walks through code, and teaches the user how to make fixes themselves. Never modifies files.
tools Read, Grep, Glob
model inherit

You are a patient, expert programming mentor. Your role is to help the user understand and improve their own code — never to make changes yourself.

# Recursively delete empty folders starting from the current directory
require 'find'
require 'fileutils'
root = '.'
empty_dirs = []
Find.find(root) do |path|
if File.directory?(path)
next if path == root
@ghall89
ghall89 / zed-swift-settings.json
Created December 29, 2025 17:58
Settings for using swiftformat in Zed
{
"languages": {
"Swift": {
"tab_size": 2,
"formatter": {
"external": {
"command": "swiftformat",
"arguments": [
"stdin",
"--stdinpath",
@ghall89
ghall89 / userChrome.css
Created October 16, 2025 18:24
Zen userChrome.css
/* Colors based on Catppuccin */
/* Catppucin Latte */
:root {
--zen-colors-primary: #ccd0da !important;
--zen-primary-color: #1e66f5 !important;
--zen-colors-secondary: #ccd0da !important;
--zen-colors-tertiary: #e6e9ef !important;
--zen-colors-border: #1e66f5 !important;
--toolbarbutton-icon-fill: #4c4f69 !important;
@ghall89
ghall89 / SearchTextFieldStyle.swift
Last active May 26, 2025 20:37
Custom SwiftUI TextFieldStyle for search fields
import SwiftUI
struct SearchTextFieldStyle: TextFieldStyle {
@Environment(\.controlActiveState) private var controlActiveState
@FocusState private var textFieldFocused: Bool
@State private var clearButtonScale: CGFloat = Constants.outScale
@State private var windowIsActive: Bool = true
@Binding var text: String
import AppleScriptObjC
import Foundation
enum AppleScriptError: Error {
case scriptCompilationFailed
case executionFailed(String)
}
func runAppleScript(script: String) throws -> String? {
var result: String?
@ghall89
ghall89 / ghostty
Last active January 8, 2025 01:35
Ghostty config
theme = dark:Bright Lights,light:AtomOneLight
cursor-style = underline
shell-integration-features = no-cursor
adjust-cursor-thickness = 4
font-size = 15
font-family = Rec Mono Linear
font-thicken = true
selection-invert-fg-bg = true
@ghall89
ghall89 / iterm-jxa.js
Last active March 28, 2024 13:28
Open multiple iTerm tabs in the same directory and run individual commands
// paste this script in Script Editor on macOS
iTerm = Application('iTerm2')
iTerm.includeStandardAdditions = true;
// change to the path to your directory
var dir = '/path/to/project'
var win