Skip to content

Instantly share code, notes, and snippets.

@BrynM
BrynM / ReadMe.md
Last active July 18, 2026 10:56
Heisenberg "Heisenbarometer" Source Code

Heisenberg - A Modern Way of Being Imprecise

Heisenbarometer

A very long time ago I took my Uncle's old mechanical barometer. Very rustic. Very traditional. Uses mercury and watchworks.

image

Somewhere along the wayt it stopped working accurately. I tried to find someone to repair and tune it, but the only folks who would even discuss it were expensive watch repair people. When they learned it had mercury, they all backed off. I can't

@BrynM
BrynM / swap_byte.cpp
Created October 7, 2025 04:49
Swap Byte Macro
/*
* This should work for ints too, but we only need bytes. Either way, both args
* must be the same type for XOR to work properly.
* https://dev.to/pauljlucas/a-generic-swap-macro-in-c-22me
* https://www.hackerearth.com/practice/notes/swapping-without-a-temporary-variable-take-care/
* https://dev.to/pauljlucas/cc-preprocessor-macros-fh5
*/
#define SWAP_BYTE(A, B) do { ( (A) ^= (B) ^= (A) ^= (B) ); } while (0)
@BrynM
BrynM / README.txt
Last active January 24, 2023 18:07
NMS Save Backup Batch File
Put the batch file in your HelloGames directory and create a shortcut to use it
on your desktop or something. On my windows machine, that directory is something
like `C:\Users\BrynM\AppData\Roaming\HelloGames`.
You'll also need a `zip` program in your `$PATH` such as 7zip (https://www.7-zip.org/).
@BrynM
BrynM / backup.bat
Created January 5, 2022 06:31
NMS Save Backup Batch File
@echo off
setlocal ENABLEDELAYEDEXPANSION
REM User settgins
set nmsSaveDir=NMS
set outDir=%nmsSaveDir%_backups
REM Automated settings
@BrynM
BrynM / ProperHelpFormatter.py
Created January 24, 2021 09:13
ProperHelpFormatter.py
class ProperHelpFormatter(configargparse.RawDescriptionHelpFormatter):
paragraph_edge = re.compile(r"(\n\s*\n)", re.MULTILINE)
class _Section(configargparse.RawDescriptionHelpFormatter._Section):
def format_help(self):
if self.parent is not None:
self.formatter._indent()
join = self.formatter._join_parts
item_help = join([func(*args) for func, args in self.items])
if self.parent is not None:
self.formatter._dedent()
@BrynM
BrynM / gt11Rankings.js
Last active May 27, 2019 04:00
gt11Rankings
// get top-level entries exclusing collapsed
var entries = $('.commentarea > .sitetable > .comment:not(.collapsed) > .entry');
var final = [];
// loop through the entries recording author, score, and page position
for (var i = 0; i < entries.length; i++) {
var tagline = entries[i].querySelector('.tagline');
// account for which score to take depending on voted state (ug)
var score = entries[i].classList.contains('likes') ? tagline.querySelector('.score.likes') : entries[i].classList.contains('dislikes') ? tagline.querySelector('.score.dislikes') : tagline.querySelector('.score.unvoted');
final.push({
"author": tagline.querySelector('.author').text,
@BrynM
BrynM / README.md
Last active November 6, 2026 16:31
Steam Workshop Subscriptions Scraper

Steam Workshop Subscriptions Scraper

Description

This is just something I whipped up to dump a listing of my own subscriptions for a particular game. Unfortunately Vavle/Steam doesn't do such a thing natively and I had to get really creative for my list of several hundred items so I could share with a friend.

So I made this little monstrosity over an evening.

Use

@BrynM
BrynM / make.bat
Created August 15, 2017 04:15
For those compiling Go or GCC on Windows via mingw32-make
@echo off
REM For use with mingw32-make.exe
REM http://www.mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite
mingw32-make.exe %*
@BrynM
BrynM / Sublime Snippets - PHP Documentor
Last active July 14, 2018 00:17
Sublime Snippets - PHP Documentor
# naming gists is dumb...
@BrynM
BrynM / _Riddick_Votes_README.md
Last active February 15, 2016 05:19
Riddick Upvote Models

Riddick vote models in obj format

Since obj files are just text, here are the models I used. Feel free to re-use them. I consider them public domain.

If you can't simply "save" one of the obj files below, just create a new file, paste in the desired text, and rename it with a ".obj" extension.