Skip to content

Instantly share code, notes, and snippets.

@BrettWitty
BrettWitty / hacks.js
Created June 18, 2023 11:55
A way to hack around some of the HTML lost when Parchment interprets a HTML TADS 3 file as plaintext
$(document).ready(function() {
function replaceText() {
$(".Style_normal").each(function() {
// Call each replacement once
var text = $(this).text();
var hyphenCount = (text.match(/-/g) || []).length;
if (hyphenCount > 4) {
var replaced = text.replace(/-{4,}/g, "<hr/>");
$(this).html(replaced);
@BrettWitty
BrettWitty / category.el
Last active December 31, 2022 03:39
Custom HTML styling using org-publish
(defun bew/org-roam-is-stub ()
(let ((filetags (org-roam-get-keyword "FILETAGS")))
(if filetags (equal '("STUB") (member "STUB" (split-string filetags ":" t))))))
(defun bew/exocortex-link-decorations ()
"Get little markup for links like stubs."
(if (bew/org-roam-is-stub)
"{{{stub()}}}"
""
))
@BrettWitty
BrettWitty / tile_example.rs
Last active September 1, 2020 12:08
Weird bug in Bevy example
use bevy::prelude::*;
use bevy::render::pass::ClearColor;
const WIDTH: u32 = 16;
const HEIGHT: u32 = 16;
struct Tile {
x: u32,
y: u32
}
@BrettWitty
BrettWitty / animation.py
Last active January 13, 2018 11:07
Animation System for RogueAgent
import system
# Entities that need animation get an AnimationComponent
class AnimationComponent(object):
__slots__ = ('animations', 'enabled')
def __init__(self, *, animations=[]):
# List of currently applied (not necessarily running!) animations
@BrettWitty
BrettWitty / keybase.md
Last active September 19, 2017 11:48
keybase.md

Keybase proof

I hereby claim:

  • I am brettwitty on github.
  • I am brettwitty (https://keybase.io/brettwitty) on keybase.
  • I have a public key ASBB3asf_4p9gUA__YACA96-iXfNpB2NVOaFN-uxuhFY5Ao

To claim this, I am signing this object: