Skip to content

Instantly share code, notes, and snippets.

View glowinthedark's full-sized avatar

glowinthedark glowinthedark

  • URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known>
  • HTTPError: HTTP Error 403: Forbidden
View GitHub Profile
@glowinthedark
glowinthedark / Installing PyICU, libpostal, pypostal on Mac OS X 10.14+.md
Last active May 31, 2026 12:31 — forked from ddelange/Installing PyICU, libpostal, pypostal on Mac OS X 10.14+.md
Installation instructions for libicu-dev, PyICU, libpostal, pypostal on Mac OS X

Installing PyICU, libpostal, pypostal on Mac OS X 10.14+

libicu-dev (PyICU dependency)

brew reinstall pkg-config icu4c
@glowinthedark
glowinthedark / mlx_audio_text_to_speech_generate.py
Last active May 1, 2026 12:51
macOS TTS with Qwen3-TTS via MLX
#!/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
@glowinthedark
glowinthedark / adb-pull-apk.sh
Created April 3, 2026 11:26
get APK from android device
#!/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;
@glowinthedark
glowinthedark / uri-percent-encode.sh
Last active February 24, 2026 12:46
uri-percent-encode.sh
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')))"
@glowinthedark
glowinthedark / whisper_bulk.py
Last active September 17, 2025 17:01
whisper bulk STT (speech-to-text) conversion, pass a glob to process multiple files
#!/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
@glowinthedark
glowinthedark / macos_textClipping_to_html.py
Last active February 2, 2026 12:10
Convert macOS .textClipping files to .html and .txt — accept multiple selected files in Finder.app
# 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>
@glowinthedark
glowinthedark / purnima_ekadashi.py
Last active August 16, 2025 13:40
Purnima (full moon), Ekadashi, Amavasya, Sunrise calculation with purnimanta, amanta, or iskcon methods
#!/usr/bin/env python3
"""
Professional Vedic Calendar Calculator using Skyfield
Calculates Ekadashi, Purnima, and Important Fasting Dates with NASA-grade precision
Installation: pip install skyfield pytz
Data files download automatically on first run (~20MB)
FIXED: Resolved Skyfield vector addition error in get_sun_moon_times()
"""
@glowinthedark
glowinthedark / bitbucket-clone-update-all-repos.py
Created June 6, 2025 09:16
bitbucket API: clone/update all repositories
import json
from pathlib import Path
import requests
import subprocess
import os
import base64
from urllib.parse import urlparse
# Configuration
@glowinthedark
glowinthedark / unconsent.js
Last active May 6, 2025 15:34
unconsent js
// ==UserScript==
// @name GDPR Cookies Unconsent
// @namespace http://legbehindneck.com/unconsent
// @version 1.0
// @description Uncheck all cookie consent checkboxes
// @author legbehindneck
// @match *://*/*
// @grant none
// ==/UserScript==