Skip to content

Instantly share code, notes, and snippets.

View logicplace's full-sized avatar
🐑

Sapphire Becker logicplace

🐑
View GitHub Profile
@logicplace
logicplace / github_colors.user.js
Created March 4, 2023 06:38
Utilize the color attribute in HTML elements (e.g. span) in rendered Markdown on GitHub
// ==UserScript==
// @name GitHub colors
// @namespace https://logicplace.com/
// @version 1.0
// @description Support span (and other tags) color on GitHub since I guess it used to work
// @author Sapphire Becker
// @match https://github.com/*
// @match https://gist.github.com/*
// ==/UserScript==
#include <pm.h>
#include <stdint.h>
// These are extra return values
int8_t reg_L, reg_B;
union {
struct {
uint8_t u150a; // $150a
uint8_t length; // $150b
function Write-RegistryOutput {
param (
[hashtable] $Keys
)
$Roots = @{
HKCR = "HKEY_CLASSES_ROOT"
HKCU = "HKEY_CURRENT_USER"
HKLM = "HKEY_LOCAL_MACHINE"
}
#include <std/mem.pat>
#include <std/sys.pat>
bitfield u24 {
value : 24;
};
fn ru(u128 n) {
return std::mem::read_unsigned($, n);
};
@logicplace
logicplace / maten_party.mprl
Created February 2, 2021 22:42
How party growth tables would be done for Tashi
static Party {
members: [
'Arnath', 'Lilith', 'Lichel', 'Cline', 'Isaiah', 'Abel',
'Nana', 'Slay', 'Kamil', 'Cynak', 'Zafan', 'Brigit',
'Satan', 'Slime', 'Nightmare', 'Kirikaze', 'White Tiger', 'Nebulous',
'Swordman'
]
list TablePoiners {

race mini

  • $192b = map width
  • $1931 = map tile base
  • $1933 = map tile location hi
  • $1934 = map tile location of current UL tile
  • $195c = map data pointer lo/mid (hi = $02)
// Clear map metadata
TITLE Game Jam music
COMPOSER YasaSheep
PROGRAMMER YasaSheep
MTIME $00FF
VOLLVL system
PAT music_test_p0 { w48 o4 %64
c.. c.. rr %2 c.. c.. rr %128 c.. c.. rr %255 c.. c.. rr
@logicplace
logicplace / music.py
Created October 9, 2019 20:28
Some music theory stuff you can import into the REPL and play around with
from collections import OrderedDict
# Ontologies
notes = ("C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B")
len_notes = len(notes)
flats = {
"C#": "Db",
"D#": "Eb",
"F#": "Gb",
"G#": "Ab",
@logicplace
logicplace / easyError.js
Created November 6, 2011 09:52
Easiest, proper custom error in JavaScript
//Ensure report
console = typeof(console)=="undefined"?{log:alert}:console;
//Quick diff function
function diffContents(c){
return "(([\\s\\S]*?)("+(c
.replace(/\\/,"\\\\")
.replace(/([\[\]{}()^$+*.?|])/,"\\$1")
)+"?))?";
}
@logicplace
logicplace / gist:951220
Created May 2, 2011 05:54
email validation regex. Complete to spec. Requires a lookarounds (trying to remove the lookbehind for JS compatibility)
^(?!\.)(([a-zA-Z0-9!#$%&'*+/=?^_`{}|~\-]|\.(?!\.))+|"[^"\n\r]+")(?<!\.)([+\-][a-zA-Z0-9!#$%&'*+/=?^_`{}|~\-.]+)?@(\[(?:[0-9]{1,3}\.){3}[0-9]{1,3}\]|[a-zA-Z][a-zA-Z\-$_@.&+!*"'(),]*)$