Skip to content

Instantly share code, notes, and snippets.

@brubsby
brubsby / life-like-cellular-automata-black-white-reversal.js
Created December 9, 2019 22:47
javascript to convert rule integer for life-like cellular automata to it's black/white reversal ruleset
//https://www.conwaylife.com/wiki/Rule_integer
//https://www.conwaylife.com/wiki/Black/white_reversal
var rule_integer = 6152; // conway's game of life
function reverse_bits(bits, size) {
let i = 0
let reversed = 0
let last
while (i < size) {
@brubsby
brubsby / rip_hotkeys.js
Last active December 15, 2020 00:25
Tampermonkey script to add some hotkeys to youtube watch pages to find rips for a track
// ==UserScript==
// @name YouTube - Open wikia link for rip
// @namespace brubsby.com
// @description script to open the respective rip wikia page from a SiIvaGunner/TimmyTurnersGrandDad/VvvvvaVvvvvvr youtube watch page.
// @include http://www.youtube.com/watch*
// @include https://www.youtube.com/watch*
// @include http://youtube.com/watch*
// @include https://youtube.com/watch*
// @include http://youtube.com/*
// @include https://youtube.com/*
// ==UserScript==
// @name xp diff
// @namespace http://tampermonkey.net/
// @version 0.1
// @description paste the exact diff of your xp when looking at your runemetrics profile json
// @author brubsby
// @match https://apps.runescape.com/runemetrics/profile/profile*
// @icon https://www.google.com/s2/favicons?sz=64&domain=runescape.com
// @grant GM_setValue
// @grant GM_getValue
@brubsby
brubsby / pellet.peggy
Created May 6, 2022 22:23
pellet (date format shorthand) peggy grammar
// peggy grammar to parse an esoteric date format shorthand named pellet
// year day of month hour of day (0-23)
// v v v
// [0-9]{0,4}[a-lA-L]{1}[0-9]{1,2}[a-dA-D]{0,1}[0-9]{0,2}
// ^ ^
// month (1-12 as char) char quarter hour (00,15,30,45)
//
// example: 22E6D14
// 2022 May 6 14:45
//
@brubsby
brubsby / minute_meteors_cantrip_anydice.txt
Created May 16, 2022 14:46
Anydice program to calculate best cantrip to use while concentrating on melf's minute meteors
function: MOD saving throw dc DC {
result: d20+MOD < DC
}
function: ATTACK attack vs AC {
result: d20+ATTACK >= AC
}
function: true or half SUCCESS DAMAGE {
result: DAMAGE / (2 - SUCCESS)
function: MOD saving throw dc DC {
result: d20+MOD < DC
}
function: ATTACK attack vs AC {
result: d20+ATTACK >= AC
}
function: true or half SUCCESS DAMAGE {
result: DAMAGE / (2 - SUCCESS)
function: MOD saving throw dc DC {
result: d20+MOD < DC
}
function: ATTACK attack vs AC {
result: d20+ATTACK >= AC
}
function: true or half SUCCESS DAMAGE {
result: DAMAGE / (2 - SUCCESS)