libicu-dev (PyICU dependency)
brew reinstall pkg-config icu4c| # /// script | |
| # requires-python = ">=3.14" | |
| # dependencies = [ | |
| # "opentelemetry-api>=1.44.0", | |
| # "opentelemetry-sdk>=1.44.0", | |
| # "opentelemetry-exporter-otlp-proto-http>=1.44.0", | |
| # ] | |
| # /// | |
| """Emit a Cucumber-style trace (suite > feature > scenario > steps) via OTLP/HTTP. |
| #!/usr/bin/env python3 | |
| """ | |
| Bulk transcription via the mlx-whisper *Python API* (Apple Silicon), tuned for | |
| maximum recognition accuracy rather than throughput. | |
| Why this exists alongside the shell wrapper: | |
| mlx-whisper's CLI (v0.4.2) exposes NO --beam-size, NO --patience, and no | |
| way to supply a temperature *tuple*. `--temperature` is a bare float, so | |
| the fallback ladder inside transcribe() is unreachable and beam search is |
| #!/usr/bin/env bash | |
| # git_truncate.sh | |
| # Truncates current branch to a single commit (squashes all history) | |
| # and force-pushes to origin. | |
| # Usage: ./git_truncate.sh [remote_name] | |
| # Default remote: origin | |
| set -euo pipefail | |
brew reinstall pkg-config icu4c| #!/usr/bin/env python3 | |
| """ | |
| TTS with Qwen3-TTS via MLX. | |
| =========================== | |
| Requirements: | |
| pip install mlx-audio soundfile numpy | |
| pip install tqdm # optional, for progress bars | |
| brew install ffmpeg |
| #!/usr/bin/env bash | |
| # Enforce strict error handling | |
| set -euo pipefail | |
| # uncomment for DEBUGGING ONLY | |
| # set -exuo pipefail | |
| # --- take package name as first arg --- |
graph LR
A["System Prompt (highest authority)"]:::sys
B["Developer / Tool Instructions<br/>(when applicable)"]:::dev
C[User Prompt]:::user
D["Conversation History<br/>(recursive influence)"]:::hist
A --> B --> C --> D
classDef sys fill:#ffddcc,stroke:#cc7744,stroke-width:2px,color:#000;| printf '%s' "$*" | jq -sRr @uri | |
| printf '%s' "$*" | xxd -p -c1 | sed 's/^/%/' | tr -d '\n' | |
| printf "\npython\n" | |
| python3 -c "import sys; print(''.join(f'%{b:02X}' for b in bytes('$*', 'utf8')))" |
| #!/usr/bin/env python3 | |
| import sys | |
| from pathlib import Path | |
| # from: https://community.openai.com/t/transcribe-lines-are-way-too-long-for-both-subtitles-and-karaoke/289059/7 | |
| print('loading whisper...', end='') | |
| import whisper | |
| from whisper.utils import get_writer |
| # in Shortcuts.app right panel (ℹ️): | |
| # [v] Use as Quick Action: | |
| # [v] Finder | |
| # Receive Files from Quick Actions | |
| # Search and add "Run Shell Script" | |
| # Shell: /usr/bin/python3 | |
| # Input: Shortcut Input | |
| # Pass Input: <as arguments> |