This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # build-hugin-macos.sh — Build Hugin 2025.0.1 from source on macOS Apple Silicon | |
| # | |
| # Usage: | |
| # bash build-hugin-macos.sh | |
| # | |
| # Output: Hugin-2025.0.1-arm64.dmg in the current directory | |
| # Install: open the DMG and drag Hugin.app to /Applications | |
| # | |
| # Tested on: macOS 15+ (Apple Silicon, M1/M2/M3/M4) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import threading | |
| import time | |
| from concurrent.futures import ProcessPoolExecutor | |
| lock = threading.Lock() | |
| def process_items(name): | |
| lock_id = id(lock) | |
| print(f"{name}: acquiring lock:{lock_id}") | |
| with lock: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /// script | |
| # requires-python = ">=3.13" | |
| # dependencies = [ | |
| # "requests", | |
| # "beautifulsoup4", | |
| # "selenium", | |
| # "ipdb", | |
| # ] | |
| # /// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env -S uv run --script | |
| # /// script | |
| # requires-python = ">=3.12" | |
| # dependencies = ["cowsay"] | |
| # /// | |
| import cowsay | |
| cowsay.cow('Hello World') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import dataclasses | |
| import logging | |
| logging.basicConfig(level='INFO') | |
| logger = logging.getLogger(__name__) | |
| @dataclasses.dataclass | |
| class DictAttrib: | |
| # class attribute |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| encodes a pair of +ive ints to an int and complementary method | |
| src: http://mathforum.org/library/drmath/view/56036.html | |
| ''' | |
| def encode_pair(a: int, b: int) -> int: | |
| ''' | |
| implements | |
| [(a + b)^2 + 3a + b]/2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| for a in *.flac; do | |
| ffmpeg -i "$a" -qscale:a 0 "${a[@]/%flac/mp3}" | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import redis | |
| import sys | |
| ip = '172.35.5.201' | |
| port = 6379 | |
| db = 1 | |
| sixty_days_back_sec = 5184000 | |
| thirty_days_back_sec = sixty_days_back_sec / 2 | |
| ten_days_back_sec = thirty_days_back_sec / 3 | |
| total=ten_db=thirty_db=sixty_db=deleted=0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| export from_name='' | |
| lockfile=$1 | |
| flock=`which flock` | |
| #uses mandrill-sendmail via @blackdotsh's https://raw.githubusercontent.com/blackdotsh/mandrillapp-cli/master/sendmail.sh | |
| sendmail=$HOME/msendmail.sh | |
| dt=`date` | |
| $flock -xn "/tmp/$lockfile" echo "${@:2}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function dbash(){ | |
| if test -z "$1" | |
| then | |
| container=`docker ps -lq` | |
| echo "Using last active container $container" | |
| else | |
| container=$1 | |
| fi | |
| docker exec -it $container bash | |
| } |
NewerOlder