Skip to content

Instantly share code, notes, and snippets.

View omgmog's full-sized avatar
👾

Max Glenister omgmog

👾
View GitHub Profile
@omgmog
omgmog / .sh
Created February 6, 2026 17:26
Poll for fastboot/adb modes on headless Pixel C tablet
prev=""
while true; do
fb="$(fastboot devices 2>/dev/null | awk '/fastboot$/ {print $1; exit}')"
ad="$(adb devices 2>/dev/null | awk 'NR>1 && NF {print $1":"$2; exit}')"
pid="$(system_profiler SPUSBDataType | awk '
/Product ID:/ {pid=$3}
/Serial Number: 5A22000865/ {print pid; exit}
')"
cur="pid=${pid:-na} fastboot=${fb:-none} adb=${ad:-none}"
#!/bin/bash
# Bigme B6 Color Debloat Script
# Disables bloatware without requiring root
#
# Setup steps:
# 1. Open xSettings -> About -> tap "Build number" 7 times to enable Developer mode
# 2. Go to xSettings -> System -> Developer options
# 3. Enable "USB debugging"
# 4. Connect device to computer via USB
@omgmog
omgmog / AudioSwitcher.1m.sh
Last active October 11, 2025 19:14
SwiftBar audio device switcher
#!/usr/bin/env bash
# <bitbar.title>Audio Output Switcher</bitbar.title>
# <bitbar.version>2.7</bitbar.version>
# <bitbar.author>Your Name</bitbar.author>
# <bitbar.desc>SwiftBar-only output switcher using SF Symbols and UID matching. Active item tinted blue.</bitbar.desc>
# <bitbar.dependencies>bash,SwitchAudioSource</bitbar.dependencies>
# <swiftbar.hideAbout>true</swiftbar.hideAbout>
# <swiftbar.hideRunInTerminal>true</swiftbar.hideRunInTerminal>
# <swiftbar.hideLastUpdated>true</swiftbar.hideLastUpdated>
# <swiftbar.hideDisablePlugin>true</swiftbar.hideDisablePlugin>
@omgmog
omgmog / switch-audio-device.lua
Last active May 9, 2025 15:44
Hammerspoon switch audio output devices
local function switchToDevice(deviceUid, alertIcon, alertMessage)
local log = hs.logger.new("switchToDevice", "debug")
local device = hs.fnutils.find(hs.audiodevice.allOutputDevices(), function(_device)
local uid = _device:uid()
local name = _device:name()
if uid and name then
return string.match(uid, deviceUid)
else
return false
function _init()
_upd=upd_title
_drw=drw_title
end
function _update()
_upd()
end
function _draw()
_drw()
end
@omgmog
omgmog / migrate-jekyll-posts-to-astro.sh
Created September 30, 2024 09:29
Migrate Jekyll filename-based post dates to Astro pubDate frontmatter
#!/bin/sh
BLOG_DIR="src/content/blog"
# Loop through each .md file in the directory
for file in "$BLOG_DIR"/*.md; do
# Extract the filename without the directory path
filename=$(basename "$file")
# Extract the date portion from the filename (yyyy-mm-dd)
@omgmog
omgmog / parallax-scroll.js
Created October 28, 2013 15:26
Simple parallax background scrolling with jQuery
$(function() {
var $el = $('.parallax-background');
$(window).on('scroll', function () {
var scroll = $(document).scrollTop();
$el.css({
'background-position':'50% '+(-.4*scroll)+'px'
});
});
});
@omgmog
omgmog / VRUXUI.md
Last active August 24, 2023 14:06
This is mirrored from the now unavailable http://vruxui.com/video-gallery

Click an image below to view the video on Youtube.

VRPlanetarium

Menu Interactions

Environment

@omgmog
omgmog / dialog.p8
Last active August 5, 2023 06:24
Dialog system for Pico-8
pico-8 cartridge // http://www.pico-8.com
version 16
__lua__
function sleep(s)
for i=1,s*30 do
flip()
end
end
@omgmog
omgmog / sdl_controllers.txt
Created July 16, 2021 08:51
Pico-8 GPi SDL controller config
030000005e0400008e02000014010000,Microsoft X-Box 360 pad,platform:Linux,a:b1,b:b0,x:b3,y:b2,back:b8,start:b9,-leftx:h0.8,+leftx:h0.2,-lefty:h0.1,+lefty:h0.4,lefttrigger:b4,righttrigger:b5,