Skip to content

Instantly share code, notes, and snippets.

View jgottula's full-sized avatar

Justin Gottula jgottula

View GitHub Profile
@jgottula
jgottula / STM-google-reddit-no-referer.js
Created November 17, 2023 08:32
Make the Reddit web experience on iPhone/iPad less miserable (RIP Apollo, fuck /u/spez)
// STOP FUCKING WITH MY REDDIT PAGES FROM SEARCH RESULTS!
// (remove referer from reddit links on google)
// for use with custom JS injection feature of StopTheMadness MobileSafari extension
'use strict';
const DEBUG = (str) => { console.debug(str); };
// generate a string of the path to the given element
// from the document root, in CSS selector form
@jgottula
jgottula / libusb_wrapper.cpp
Last active December 30, 2022 20:46
libusb_wrapper.cpp: “wow, this could use some serious boilerplate reduction”
// HOW TO BUILD:
// g++ -std=c++17 -fPIC -shared -Wl,--no-undefined -fuse-ld=gold -ldl -lbsd -lusb-1.0 -Wall -O0 -g3 -o libusb_wrapper.so libusb_wrapper.cpp
// HOW TO USE:
// LD_PRELOAD=libusb_wrapper.so <program command line>
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
@jgottula
jgottula / df_device_type.h
Last active December 2, 2021 14:23
Reverse-engineered: enum DF_DEVICE_TYPE
// reverse engineered based on Windows 10 version 21H1
// used in defragsvc.dll, dfrgui.exe, and probably other places
// (the specific enum member names seen here were invented by me)
enum DF_DEVICE_TYPE
{ // CORRESPONDING "MEDIA TYPE" STRING [with string table index from DfrgUI.exe.mui]
TYPE_UNKNOWN = 0x0, // 1188 "Unknown"
TYPE_HARD_DISK_DRIVE = 0x1, // 1179 "Hard disk drive"
TYPE_REMOVABLE_DRIVE = 0x2, // 1180 "Removable drive"
TYPE_SOLID_STATE_DRIVE = 0x3, // 1181 "Solid state drive"