Skip to content

Instantly share code, notes, and snippets.

View gingerbeardman's full-sized avatar

Matt Sephton gingerbeardman

View GitHub Profile
@gingerbeardman
gingerbeardman / crt-shader.frag
Created January 5, 2026 11:56
CRT effect as fragment shader for Love2D
// Final CRT shader with all effects including curvature
uniform float scanlineIntensity; // Adjust intensity (0-1)
uniform float scanlineCount; // Number of scanlines
uniform float time; // For flicker effect
uniform float yOffset; // Vertical drift to combat moiré pattern
uniform float brightness; // Overall brightness
uniform float contrast; // Contrast adjustment
uniform float saturation; // Color saturation
uniform float bloomIntensity; // Bloom effect intensity
@gingerbeardman
gingerbeardman / file.io.sh
Last active January 26, 2026 09:08 — forked from devster/file.io.sh
Simple cli tool to use file.io https://www.file.io/#one Install: curl https://gist.githubusercontent.com/gingerbeardman/a7737e4c89fccab8605f8538ddaeec0d/raw/a78f5253b0fcdbd7b893f91627a29498690356ea/file.io.sh | sudo tee /usr/local/bin/file.io && sudo chmod +x /usr/local/bin/file.io
#!/bin/sh
URL="https://file.io"
DEFAULT_EXPIRE="14d" # Default to 14 days
if [ $# -eq 0 ]; then
echo "Usage: file.io FILE [DURATION]\n"
echo "Example: file.io path/to/my/file 1w\n"
exit 1
fi
@gingerbeardman
gingerbeardman / remux.sh
Last active January 25, 2026 17:16
Synology DSM Task Scheduler custom script to remux any mkv files as mp4, moving old files to Recycle Bin
#!/usr/bin/env bash
# by Matt Sephton @gingerbeardman
# requires SynoCommunity ffmpeg to be installed
log="/volume1/video/Scripts/remux.log"
bin="/volume1/video/#recycle/"
work="/volume1/video/Scripts/"
export log
@gingerbeardman
gingerbeardman / localhost-server-control.py
Created January 12, 2026 21:06
HTTP Server Control as an menubar app using xbar
#!/usr/bin/env python3
# <xbar.title>HTTP Server Control</xbar.title>
# <xbar.version>3.0.0</xbar.version>
# <xbar.author>Matt Sephton</xbar.author>
# <xbar.author.github>gingerbeardman</xbar.author.github>
# <xbar.desc>Start and stop a Python HTTP servers from a specific directory</xbar.desc>
# <xbar.dependencies>python3</xbar.dependencies>
import os
import subprocess
@gingerbeardman
gingerbeardman / xcarchive-move-and-sign.sh
Created October 12, 2025 17:05
This script extracts an app from an Xcode .xcarchive, alerts the user, kills any running versions, moves it to /Applications, re-signs it with the specified Developer ID, and then launches the newly signed app.
FILE=`basename "$@" .xcarchive`
PARENT=`dirname "$@"`
ditto "$@"/Products/Applications/ $PARENT/.
printf "\a"
# List all .app directories in $PARENT
for app_path in "$PARENT"/*.app; do
# Extract the app name (basename without .app extension)
app_name=$(basename "$app_path" .app)
@gingerbeardman
gingerbeardman / volumes.60s.sh
Last active June 24, 2025 12:44
xbar/bitbar shell script to list and clean and eject (unmount using option) volumes as a replacement for CleanMyDrive
#!/bin/zsh
# <bitbar.title>Volume Manager</bitbar.title>
# <bitbar.version>250624</bitbar.version>
# <bitbar.author>Matt Sephton</bitbar.author>
# <bitbar.author.github>gingerbeardman</bitbar.author.github>
# <bitbar.desc>Lists and manages mounted user volumes</bitbar.desc>
# <bitbar.dependencies>zsh</bitbar.dependencies>
# <bitbar.abouturl>https://gist.github.com/gingerbeardman/610f22180117ad20465d7c529cc5faa0</bitbar.abouturl>
setopt EXTENDED_GLOB
@gingerbeardman
gingerbeardman / huginn.yahooauctions.json
Last active June 13, 2025 01:47
Huginn JSON for Yahoo! Japan Auctions, for importing into a Scenario
{
"expected_update_period_in_days": "1",
"url": [
"https://auctions.yahoo.co.jp/search/search?p=花札&en=Hanafuda&exflg=1&b=1&n=100&s1=new&o1=d&mode=1",
],
"type": "html",
"mode": "on_change",
"extract": {
"url": {
"css": "a.Product__titleLink",
@gingerbeardman
gingerbeardman / csv2md.sh
Created June 3, 2025 22:59
TSV/CSV to Markdown table
pbpaste | tr "," ";" | tr "\t" ',' | csvtomd -p 0 | sed 's/&/\&amp;/g' | sed 's/|/ | /g' | sed 's/ */ /g; s/^ *//; s/ *$//' | sed 's/^/| /; s/$/ |/' | tr ';' ','
@gingerbeardman
gingerbeardman / dismiss_notifications.sh
Created June 1, 2025 19:20
Dismiss all notifications
osascript -e '
tell application "System Events"
tell process "NotificationCenter"
if not (window "Notification Center" exists) then return
set alertGroups to groups of first UI element of first scroll area of first group of window "Notification Center"
repeat with aGroup in alertGroups
try
perform (first action of aGroup whose name contains "Close" or name contains "Clear")
on error errMsg
log errMsg
@gingerbeardman
gingerbeardman / pair-wii-remote-macos.sh
Last active April 28, 2025 19:48
Automatically pair a Wii Remote to macOS using blueutil command-line tool (Intel-only? fails on Apple silicon)
#!/usr/bin/env bash
# requirements: blueutil
echo "Hold both 1+2 buttons on Wii Remote and wait for 30 seconds"
# get MAC Address of Wii Remote
MAC=`$(which blueutil) --inquiry 5 2>&1 | grep 'address' | awk '{print substr($2,1,17)}'`
(killall -m 'blueutil*' 2>&1) >/dev/null
echo "MAC: $MAC"