Skip to content

Instantly share code, notes, and snippets.

View sjml's full-sized avatar
✝️
AMDG

Shane Liesegang sjml

✝️
AMDG
View GitHub Profile
@sjml
sjml / README.md
Last active May 31, 2022 11:48
Pandoc Lua filters for BS STM

This is a collection of filters I run as part of a packaging script for research papers. Basically makes modifications to standard Chicago Style to match the citation standards of the BC STM. Note, that especially for things like the encyclicals, this relies on working in concert with carefully formatted bibliography data.

Anything starting with filter- gets put into the pandoc invocation before --citeproc; anything starting with post-filter gets put after.

I'm sure a lot of this code could be improved. :)

@sjml
sjml / unstick_onedrive.bat
Last active January 21, 2022 12:14
Unsticking OneDrive on Windows
@echo off
rem Sometimes OneDrive gets stuck and won't be able to sync files.
rem It will just spin on "looking for changes" or some nonsense.
rem (This seems to especially happen when the internet is not reliable
rem or perhaps just in certain geographic regions? I haven't been able
rem to find out. I live in the Middle East, though, and OneDrive is
rem super unreliable and it makes me sad.)
rem This script resets its syncing status and restarts the app,
rem but it means it may have to take a while to get back to
@sjml
sjml / fix_branch_name.sh
Last active June 23, 2020 20:04
Rename Git default branch to "main"
#/usr/bin/env bash
# This is a script to automate changing the name of the
# default branch of your git repository from "master"
# to "main". Run it in the root directory of your local
# clone.
#
# If you don't want to run this directly (and I wouldn't
# blame you!) it can at least serve as a guide to what
# you would want to do.
@sjml
sjml / how-to-install-platon.md
Last active May 27, 2020 18:19
Install Platon

UNMAINTAINED

This script probably still works, but might not. Check the version in my GitHub repository.

Installing Platon

This is a script that can be used to easily install platon on macOS. If it doesn't work for you for some reason, leave a comment explaning what went wrong.

You can run this automatically by opening the Terminal app (in /Applications/Utilities) and

@sjml
sjml / hugo-compare.sh
Last active December 28, 2020 12:25
Compare hugo output across versions
#!/usr/bin/env bash
# Compares the output directory for two versions of Hugo (https://gohugo.io), so you
# can know how updating to a new version will affect your content generation.
# exit on error
set -e
# the current Hugo project that I care about testing
@sjml
sjml / acb_truth_fourier.py
Last active December 8, 2019 17:35
Output solutions for the Fourier transform puzzles in Assassin's Creed: Brotherhood
# Assassin's Creed Brotherhood has these silly fourier transform puzzles.
# Cluster 9 was bothering me so instead of solving it, I wrote this
# program to solve all of them.
#
# This was not the best use of my time, but I enjoyed it more than
# I did *actually* solving the puzzles, so who is the winner now?!
#
# Output at the bottom.
import itertools
@sjml
sjml / stub.py
Last active February 28, 2019 00:49
watch hex output live
# monitors a process that is outputting a stream of bytes and prints them live in hex form to stdout.
# could be made more pretty with ncurses and the like, but this does what it needs to do.
import sys
import subprocess
subprocess.run(["tput", "smcup"])
proc = subprocess.Popen(sys.argv[1:], bufsize=0, stdout=subprocess.PIPE)