Skip to content

Instantly share code, notes, and snippets.

View stormychel's full-sized avatar
🍏

Michel Storms stormychel

🍏
View GitHub Profile
@stormychel
stormychel / install-claude-david-hook.py
Last active May 25, 2026 09:15
[Windows] Claude Code Stop hook — announces 'Claude is done' via SAPI Microsoft David Desktop voice at rate +2 (PowerShell System.Speech.Synthesis). macOS sibling: https://gist.github.com/stormychel/502e2a6da38bf5798750e5565a5324f7
#!/usr/bin/env python3
"""
Install a Claude Code "Stop" hook that announces completion out loud on Windows
using SAPI (System.Speech) with the Microsoft David Desktop voice at rate +2 —
i.e. it runs the equivalent of `say -v Zarvox "Claude is done"` from the macOS
sibling gist (https://gist.github.com/stormychel/502e2a6da38bf5798750e5565a5324f7).
System-wide: writes to %USERPROFILE%\.claude\settings.json (merges, preserves
existing keys). Idempotent: re-running won't add a duplicate.
@stormychel
stormychel / install-claude-zarvox-hook.py
Last active May 25, 2026 09:16
[macOS] Claude Code Stop hook — announces 'Claude is done' via the macOS Zarvox voice (say -v Zarvox). Windows sibling: https://gist.github.com/stormychel/a2b6a437873b62b4e9750186babcc658
#!/usr/bin/env python3
"""
[macOS] Install a Claude Code "Stop" hook that announces completion out loud
with the macOS Zarvox voice — i.e. it runs `say -v Zarvox "Claude is done"`
every time Claude finishes a response.
Windows sibling (SAPI / David voice):
https://gist.github.com/stormychel/a2b6a437873b62b4e9750186babcc658
System-wide: writes to ~/.claude/settings.json (merges, preserves existing keys).
@stormychel
stormychel / claude_auto_setup.md
Created March 7, 2026 02:01
claude_auto — Run Claude Code without permission prompts (macOS & Windows)

claude_auto — Run Claude Code Without Permission Prompts

What It Does

claude_auto is a shell alias/function that launches Claude Code with the --dangerously-skip-permissions flag. Claude Code runs without prompting for approval on tool calls (file edits, bash commands, etc.) — everything is auto-approved.

Useful for hands-off workflows where you trust Claude to execute freely. Use at your own risk — Claude can run any command, edit any file, and make destructive changes without asking.


@stormychel
stormychel / gist:dc1bdfc68bf69a423a61f96740f76159
Created January 26, 2026 13:51
Claude Code with Local Backends (Ollama & LM Studio)
Run **Claude Code** (Anthropic's agentic coding tool) with local / open-source models instead of paying for Claude Pro / API credits.
Claude Code officially supports the **Anthropic API** format → tools that emulate it (like Ollama ≥ 0.14 and some LM Studio setups via proxies) allow you to use powerful local models while keeping almost all features: file read/write, command execution, multi-agent workflows, MCP, plugins, etc.
## 1. Ollama (Recommended – Native Support)
Since **Ollama v0.14.0+** (late 2025), there is **official support** for the Anthropic-compatible endpoint.
### Requirements
- Ollama ≥ 0.14.0
@stormychel
stormychel / macOS_SytemPrefs.md
Created January 8, 2026 09:59 — forked from rmcdongit/macOS_SytemPrefs.md
Apple System Preferences URL Schemes

macOS 10.15 System Preference Panes

Below are a list of System Preference pane URLs and paths that can be accessed with scripting to assist users with enabling macOS security settings without having to walk them through launching System Preferences, finding panes, and scrolling to settings. Not all panes have an accessible anchor and some are OS specific.

To find the Pane ID of a specific pane, open the System Preferences app and select the desired Preference Pane. With the pane selected, open the ScriptEditor.app and run the following script to copy the current Pane ID to your clipboard and display any available anchors:

tell application "System Preferences"
	set CurrentPane to the id of the current pane
	set the clipboard to CurrentPane
@stormychel
stormychel / quartz-point.swift
Created November 9, 2025 08:49
Cocoa to Quartz point conversion
/// Converts a Cocoa global point (origin at lower-left) into Quartz display coordinates (origin at upper-left). - #763
static func quartzPoint(from cocoaPoint: CGPoint) -> CGPoint {
let screens = NSScreen.screens
// Find screen containing the point; fall back to main screen
let targetScreen = screens.first { NSMouseInRect(cocoaPoint, $0.frame, false) } ?? NSScreen.main
guard let screen = targetScreen else { return cocoaPoint }
// Translate into screen-local coordinates
let localY = cocoaPoint.y - screen.frame.origin.y
@stormychel
stormychel / pbcopy.ps1
Last active April 15, 2025 09:23
PowerShell pbcopy function for Windows (mimics macOS pbcopy)
<#
pbcopy.ps1 — A PowerShell function to mimic macOS `pbcopy`
📌 Usage:
"Hello world" | pbcopy
pbcopy # then type text, Ctrl+Z + Enter
📁 Install:
- Save this file somewhere on disk, e.g. C:\Scripts\pbcopy.ps1
- Open your PowerShell profile: notepad $PROFILE
@stormychel
stormychel / gist:91ddb46a529526150a7b2d2b41491815
Created September 23, 2024 03:02
Conditionally Display SwiftUI View Based on a Boolean
extension View {
/// Conditionally displays the view based on the provided Boolean condition.
///
/// This modifier allows you to show or hide a view depending on the value of `condition`.
/// If `condition` is `true`, the view is displayed as is.
/// If `condition` is `false`, the view is replaced by an `EmptyView`, which effectively removes it from the layout.
///
/// - Parameter condition: A Boolean value that determines whether the view should be displayed. If `true`, the view is shown; if `false`, it is hidden.
/// - Returns: Either the view itself, or an `EmptyView` if the condition is `false`.
///
@stormychel
stormychel / URLResponse+HTTP.swift
Created May 9, 2024 04:33 — forked from messeb/URLResponse+HTTP.swift
URLResponse as HTTPURLResponse and check if call has status code 2xx
extension URLResponse {
/// Returns casted `HTTPURLResponse`
var http: HTTPURLResponse? {
return self as? HTTPURLResponse
}
}
extension HTTPURLResponse {
/// Returns `true` if `statusCode` is in range 200...299.
/// Otherwise `false`.
@stormychel
stormychel / Iso369_1.swift
Created June 22, 2023 15:18 — forked from proxpero/Iso369_1.swift
A Swift 4.0 enum representing ISO 639-1 codes (used to classify languages)
// taken 2018-03-19 from wikipedia. https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
public enum Iso639_1: String {
case ab = "AB"
case aa = "AA"
case af = "AF"
case ak = "AK"
case sq = "SQ"
case am = "AM"
case ar = "AR"