Skip to content

Instantly share code, notes, and snippets.

View maddada's full-sized avatar

Mohamad Yahia maddada

View GitHub Profile
@maddada
maddada / dormant-worktrees.html
Created November 5, 2026 02:33
Ghostex: ideas for dormant worktrees and their sessions (pick A, B or C on Discord)
<!doctype html>
<html lang="en">
<head><!--gx-builtin--><meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'unsafe-inline' 'unsafe-eval' https:; style-src 'unsafe-inline' https:; img-src data: blob: https:; font-src data: https:; connect-src https: 'self'; media-src data: blob: https:; frame-src 'none'; form-action 'none'; base-uri 'none'"><style id="ghostex-theme">:where(:root){color-scheme:dark;--background:#131313;--foreground:#c8cdd5;--muted:#2a2a2a;--muted-foreground:#747b85;--card:#252525;--card-foreground:#c8cdd5;--border:rgba(255,255,255,0.11);--input:rgba(255,255,255,0.15);--ring:#737373;--primary:#7da4f8;--primary-foreground:#0e0e0e;--accent:#2a2a2a;--accent-foreground:#e5e7eb;--destructive:#fb7185;--warning:#fbbf24;--success:#34d399;--info:#86d3f8;--code-background:#161616;--code-foreground:#e6edf3;--chart-1:#60a5fa;--chart-2:#f59e0b;--chart-3:#34d399;--chart-4:#f472b6;--chart-5:#a78bfa;--chart-6:#22d3ee;--radius:8px;--font-sans:-apple-system, BlinkMacSystemFont, "Se
@maddada
maddada / gist:d17254fb7921d0263fc273935b627150
Created October 11, 2026 10:11
Faster rebuilds and less disk for Rust + GPUI projects
These notes come from Ghostex, a GPUI desktop app (one ~170k-line app crate) with a ~168k-line Rust server next to it. Everything below is something we turned on, measured or deliberately rejected while getting a one-line edit to rebuild and relaunch in about 10 seconds. Each section says what we did and why, then gives a version you can copy into your own project.
Measurements were taken on an M5 Pro (18 cores, 64 GB) unless noted.
---
## The starter kit (copy this first)
1. Install sccache: `brew install sccache`, `winget install --id Mozilla.sccache --exact`, or `cargo install sccache --locked`.
2. Put this in `.cargo/config.toml` at the root of your project:
@maddada
maddada / gist:b264ea4f63d1633f4641f4257e17852d
Last active September 6, 2026 16:30
2026-09-06 zmx tail optimisation

AI summary:

Polling now captures the active grid plus up to 512 scrollback rows rather than 50 lines, which bounds per-poll daemon CPU, socket bytes, and gxserver buffering independent of session age.

Capture per poll Before today Now
Rows the daemon formats entire scrollback (up to the retention cap) grid (50 rows resting, or the visible client's height) + up to 512 rows
Bytes over the socket full history, then cut to a 256 KiB tail in gxserver typically 5 to 60 KB, worst case about 110 KB
Alternate-screen TUI its grid plus stale primary-screen history its grid only
@maddada
maddada / gist:efa32723938db728cd5b5ae69a924b5c
Created September 5, 2026 01:53
Build Ghostex for Intel Mac from Source
Help me build and run Ghostex from source on this Intel MacBook. Do the work yourself, investigate failures, fix their root causes, and keep rebuilding until the app works or you identify a concrete blocker that requires my input.
You are authorized to install the required development tools and dependencies, edit this Ghostex checkout, and repeatedly run `bun run start`. That command may rebuild, install, replace, and restart the matching Ghostex development app.
Repository:
https://github.com/maddada/Ghostex.git
1. Inspect this machine and prepare the checkout
- Confirm the actual CPU architecture, macOS version, available disk space, and developer tools.
@maddada
maddada / gist:deb0fd2e614b5c1dc0add63beea4787c
Created May 12, 2026 05:43
npm/pnpm/bun better security instructions
# Package Manager Security Handover
I added user-level install hardening for npm, pnpm, and Bun on this machine.
## What Changed
### npm
Updated `~/.npmrc` with:
@maddada
maddada / 2026-01-28-my-claude-code-statusline.md
Created January 28, 2026 01:29
2026-01-28-my-claude-code-statusline

Set up my Claude Code statusline configuration

Follow these steps exactly:

1. Add the statusline command to Claude Code settings

Edit ~/.claude/settings.json and add this statusLine key (merge with existing content if the file exists):

{
@maddada
maddada / gist:3682924780ea28767c5eeb49e1c0c6ed
Created January 10, 2026 19:53
full conversations claude in chrome vs playwriter
▐▛███▜▌ Claude Code v2.1.3
▝▜█████▛▘ Opus 4.5 · Claude Max
▘▘ ▝▝ /Users/madda
❯ /clear
⎿  (no content)
❯ go to google image search, search for potato, grab the link to the first
image in that page and get me the console logs of the page. use
@maddada
maddada / setting-default-editor-for-claude-code.md
Last active August 19, 2026 08:59
Setting Default Editor for Claude Code

To set the default editor in Mac, Linux, Windows:

1. 🖥️ macOS (Default: Zsh)

On a modern macOS system, the default shell is Zsh.

  • File: ~/.zshrc (This file is in your home directory. The ~ is a shortcut for /Users/yourusername).
  • How to Edit:
    1. Open your terminal.
  1. Type nano ~/.zshrc to open the file in a terminal editor.
@maddada
maddada / gist:865364f5be840a20311f88ba43d84fd2
Created August 4, 2025 18:25
Goal: Organize my tabs into groups
Goal: Organize my tabs into groups
Here is a list of ungrouped tabs provided in the following format:
id ||| title ||| url
<tabs_list>
${tabs.map((t) => `${t.id} ||| ${t.title} ||| ${t.url}`).join("\n")}
</tabs_list>
Please adhere strictly to the following rules:
@maddada
maddada / gist:b7198f71181db2e2810d8234f5a9781e
Created June 26, 2025 04:31
2025-06-26 My clipdiary config
[Options]
ConfigOK=1
AlwaysOnTop=0
IncrementalSearch=1
HideWindowAfter=0
CollapseTreeAfterPasting=1
UseShortcutsSN=1
UseShortcutsCH=1
CurrentTabNumber=0
HotKeysList=1,0,0;2,6,81;3,6,65;4,7,86;5,0,0;6,2,192;7,0,0;8,0,0;9,0,0;10,0,0;11,0,0;