Skip to content

Instantly share code, notes, and snippets.

View mvandermeulen's full-sized avatar

Mark mvandermeulen

  • Fivenynes
  • Sydney, Australia
  • 14:47 (UTC +10:00)
View GitHub Profile
@mvandermeulen
mvandermeulen / Alacritty + tmux.md
Created March 23, 2026 06:16 — forked from ashwch/Alacritty + tmux.md
Alacritty + tmux: Ghostty-like keyboard shortcuts (Cmd+T, Cmd+D, Cmd+1-9, etc.)

Alacritty + tmux: Ghostty-like Keyboard Shortcuts

This configuration gives you Ghostty-style keyboard shortcuts (Cmd+D, Cmd+T, etc.) in Alacritty + tmux, providing a consistent terminal experience across different setups.

Why Use This?

  • Consistent shortcuts: Same muscle memory whether using Ghostty, iTerm2, or Alacritty+tmux
  • tmux benefits: Session persistence, remote pairing, detach/reattach, scriptable layouts
  • Works everywhere: tmux runs on any server, so your workflow travels with you
@mvandermeulen
mvandermeulen / tmux_claude_switcher.sh
Last active March 23, 2026 06:08 — forked from htlin222/tmux_claude_switcher.sh
tmux Claude session switcher - fzf-powered fuzzy finder to switch between active Claude panes or resume inactive sessions
#!/bin/zsh -f
# Suppress all stderr during cache building
exec 2>/dev/null
# title: "tmux_claude_switcher"
# version: 3.6.1 - sort inactive by recency (newest first)
# description: Claude pane switcher - active panes fresh, inactive sessions cached
#
# ============================================================================
# TMUX SETUP TUTORIAL
# ============================================================================
@mvandermeulen
mvandermeulen / tmux_claude_switcher.sh
Last active March 23, 2026 06:08 — forked from htlin222/tmux_claude_switcher.sh
tmux Claude session switcher - fzf-powered fuzzy finder to switch between active Claude panes or resume inactive sessions
#!/bin/zsh -f
# Suppress all stderr during cache building
exec 2>/dev/null
# title: "tmux_claude_switcher"
# version: 3.6.1 - sort inactive by recency (newest first)
# description: Claude pane switcher - active panes fresh, inactive sessions cached
#
# ============================================================================
# TMUX SETUP TUTORIAL
# ============================================================================
@mvandermeulen
mvandermeulen / fetch-claude-usage.swift
Created March 19, 2026 16:51 — forked from solrz/fetch-claude-usage.swift
Claude Code Statusline - Shows context usage (C:), 5-hour API usage (S:), and weekly usage remaining (W:) with color gradients
#!/usr/bin/env swift
import Foundation
func readSessionKey() -> String? {
// TODO: Replace with your session key from claude.ai cookies
let injectedKey = "YOUR_SESSION_KEY_HERE"
let trimmedKey = injectedKey.trimmingCharacters(in: .whitespacesAndNewlines)
return trimmedKey.isEmpty ? nil : trimmedKey
}
@mvandermeulen
mvandermeulen / reclaimFocus.swift
Created March 19, 2026 16:50 — forked from steventheworker/reclaimFocus.swift
reclaimFocus (by u/TheHiddenHeathen) v1.0 as seen on: r/MacOS/comments/u7egn7/window_management_lack_of_consistency_drives_me
// compile it with swiftc in terminal and then run output binary as shell script within BetterTouchTool.
import Cocoa
func reclaimFocus() {
let options = CGWindowListOption(arrayLiteral: CGWindowListOption.excludeDesktopElements, CGWindowListOption.optionOnScreenOnly)
let windowListInfo = CGWindowListCopyWindowInfo(options, CGWindowID(0))
guard
let infoList = windowListInfo as NSArray? as? [[String: AnyObject]] else {
return
}
@mvandermeulen
mvandermeulen / Process+InteractiveEscalation.swift
Created March 19, 2026 16:49 — forked from stephancasas/Process+InteractiveEscalation.swift
Synchronously prompt the user for permission to dispatch a new privilege-escalated Process.
//
// Process+InteractiveEscalation.swift
//
//
// Created by Stephan Casas on 6/26/24.
//
import Foundation;
import OSAKit;
@mvandermeulen
mvandermeulen / ScriptHelper.swift
Created March 19, 2026 16:32 — forked from GeroHerkenrath/ScriptHelper.swift
Demo for Swift scripts that import other (.swift) helper files to make code easier to reuse. Works by compiling the helpers to a module first.
/// This file contains some helper properies, functions, and types that make writing other scripts a lot easier.
/// Put this and the related `rebuildBinaries.swift` file into a folder named "ScriptHelper" on the same level as
/// the scripts or adapt the paths below accordingly.
///
/// To then use the helper in a Swift script you need to do three things:
/// 1. Compile it into an importable module
/// 2. Make it visible and linkable to your script and import it in its code
///
/// For the first point there is a helper script provided, see `rebuildBinaries.swift`. It's also a Swift script,
/// but does not depend on these helpers. Used as is it compiles the module into a `bin` folder and simply names
@mvandermeulen
mvandermeulen / center-window.swift
Created March 19, 2026 16:32 — forked from T1T4N/center-window.swift
A short script to center the foremost window on screen
#!/usr/bin/env swift
import AppKit
// Function to get the frontmost window
func getFrontmostWindow() -> AXUIElement? {
guard let app = NSWorkspace.shared.frontmostApplication else {
return nil
}
let appElement = AXUIElementCreateApplication(app.processIdentifier)
@mvandermeulen
mvandermeulen / new-uuid-v7.swift
Created March 19, 2026 16:31 — forked from lyohe/new-uuid-v7.swift
UUID v7 を生成するための Raycast script command
#!/usr/bin/swift
// Required parameters:
// @raycast.schemaVersion 1
// @raycast.title New UUID v7
// @raycast.mode compact
//
// Optional parameters:
// @raycast.icon 🆔
// @raycast.packageName UUID Utilities
// @raycast.description Generate a draft-spec UUID version 7 and copy it to the clipboard.
import SwiftUI
import Speech
import AVFoundation
import Combine
import Observation
@Observable
class SpeechRecognizer {
var transcription: String = ""
var isTranscribing: Bool = false