Skip to content

Instantly share code, notes, and snippets.

View gingerbeardman's full-sized avatar

Matt Sephton gingerbeardman

View GitHub Profile
@gingerbeardman
gingerbeardman / 192.168.1.1.user.js
Created July 26, 2026 22:25
Automatic login to your Nokia FastMile 5G Gateway 3.2 (don't forget to add your password)
// ==UserScript==
// @name Nokia FastMile Auto Login
// @match http://192.168.1.1/*
// @run-at document-start
// @grant none
// ==/UserScript==
// ---- YOUR CREDENTIALS ----------------------------------------------------
const USERNAME = 'admin';
const PASSWORD = 'PUT_YOUR_PASSWORD_HERE';
@gingerbeardman
gingerbeardman / llvm-mos-native16.md
Last active June 29, 2026 14:07
llvm-mos: experimental native 16-bit accumulator codegen (65816) — +native-16bit-accumulator

llvm-mos: experimental native 16-bit accumulator codegen (65816)

A small, flag-gated addition to the llvm-mos backend that makes the compiler emit native 16-bit accumulator code for the WDC 65816 — int16/uint16 add/sub/and/or/xor become REP #$20 … SEP #$20 regions instead of byte-at-a-time sequences.

The feature (+native-16bit-accumulator) is off by default and no CPU implies it. The existing C ABI, pointer model, 8-bit X/Y, banking, and the 8-bit accumulator at function boundaries are all unchanged, so feature-enabled and

@gingerbeardman
gingerbeardman / controller_types.cfg
Created April 29, 2026 12:45
BlastEm emulator controller configuration for 8bitdo M30 gamepad
03000000c82d00000530000001000000 {
mapping 8BitDo M30 Wireless Controller,a:b0,b:b1,x:b3,y:b4,start:b11,leftshoulder:a5,rightshoulder:a4,dpup:a1-,dpdown:a1+,dpleft:a0-,dpright:a0+,lefttrigger:b6,righttrigger:b7
subtype saturn
variant 6b bumpers
}
@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 / 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 / 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 / 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 / deark-pict.sh
Last active April 16, 2025 22:54
decompress .tar and .tar.gz then run a 2-pass deark on all resulting files to extract all PICT and keep only the resulting PNG
#!/usr/bin/env zsh
# Check if source folder is provided
if [ -z "$1" ]; then
echo "Usage: $0 <source_folder>"
exit 1
fi
SOURCE_DIR="$1"
DEST_DIR="${SOURCE_DIR}_extracted"
@gingerbeardman
gingerbeardman / vector-auto-download.js
Created April 1, 2025 12:43
Automatically redirects to download page and clicks the download button, for temporary use
// Redirect to file download at Vector.co.jp
if (window.location.host === 'www.vector.co.jp' && window.location.pathname.startsWith('/soft/')) {
// Extract file ID by removing non-numeric characters
const fileId = window.location.href.replace(/\D/g, '');
// Construct new URL with file ID
window.location.href = `https://www.vector.co.jp/download/file/mac/game/fh${fileId}.html`;
}
// Auto-click the first link in #summary section on Vector.co.jp download pages