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 / 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==
@glowinthedark
glowinthedark / towerinstruct_lm_studio_client.py
Created March 6, 2025 09:44
towerinstruct translate English to French
#!/usr/bin/env python3
import json
import re
import sys
from pathlib import Path
# install with: pip3 install openai — see https://pypi.org/project/openai/
from openai import OpenAI
const pw = require('playwright');
const UserAgent = require('user-agents');
const uuid = require('uuid');
const tmp = require('tmp-promise');
const UINT32_MAX = (2 ** 32) - 1;
const WEBGL_RENDERERS = ['ANGLE (NVIDIA Quadro 2000M Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (NVIDIA Quadro K420 Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (NVIDIA Quadro 2000M Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (NVIDIA Quadro K2000M Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (ATI Radeon HD 3800 Series Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (AMD Radeon R9 200 Series Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D