Skip to content

Instantly share code, notes, and snippets.

View keeferrourke's full-sized avatar
🎯
Focusing

Keefer keeferrourke

🎯
Focusing
View GitHub Profile
"$schema" = 'https://starship.rs/config-schema.json'
###
# Symbol bank
# Font: Hack NF FC Ligatured CCG
# Font source: https://github.com/gaplo917/Ligatured-Hack
#
# Pipes: ╰─ ╭─ ⎩ ⎧
# Powerline symbols:                                   
# Folders:   屢           
@keeferrourke
keeferrourke / how-i-take-notes.md
Last active January 18, 2026 06:15
Typesetting with Pandoc Markdown

Typesetting with Pandoc Markdown: How I Take Notes

Preface

Over the past couple years in school, I've placed tremendous value in a few things:

  • Comprehensive, single-document summaries of courses I've taken;
  • Beautifully type-set reports;
  • Writing the bare-minimum of LaTeX to get by.
@keeferrourke
keeferrourke / JavaUtil.java
Created November 18, 2020 18:12
Simple Java implementation of some patterns I really enjoy from Kotlin.
class JavaUtil {
/**
* Runtime checks, similar to the Kotlin standard library check method.
*/
public static void check(boolean condition, String message) {
if (!condition) {
throw new IllegalStateException(message);
}
}
@keeferrourke
keeferrourke / ns3-newsim.py
Created November 1, 2020 17:15
Scaffolds a C++ scratch simulation in an ns3-source directory.
#!/usr/bin/env python3
# Run this script to initialize a new sub project in the scratch/
# directory of an ns-3 distribution. This should allow one to get
# started with the simulator more quickly.
#
# author: Keefer Rourke <krourke@uoguelph.ca>
# license: ISC
#
# Copyright 2020 Keefer Rourke
@keeferrourke
keeferrourke / analysis.md
Created July 29, 2020 21:37 — forked from theres-waldo/analysis.md
C++ compiler error analysis

Starting point: mozilla-central with https://phabricator.services.mozilla.com/D85296 and dependent patches applied.

First, we make this change to trigger the error.

The relevant part of the error is:

 0:06.54 /home/botond/dev/projects/mozilla/central/dom/system/IOUtils.cpp:204:3: error: no matching function for call to 'InvokeAsync'
 0:06.54   InvokeAsync(
 0:06.54   ^~~~~~~~~~~
@keeferrourke
keeferrourke / WorkerScope.js
Created June 9, 2020 15:21
A little JS class to help with running functions in web workers.
/**
* WorkerScope prepares a function to be run in a web worker
* without needing an external JavaScript file or forcing you
* to deal with event listener.
*
* Example usage:
*
* await result = new WorkerScope(
* () => self.postMessage('hi!')
* ).run() // 'hi'
@keeferrourke
keeferrourke / git-loccount.sh
Created June 25, 2019 17:34
Pretty print total added, removed, and contrib lines of code in a git repo for a user.
#!/usr/bin/env bash
# git-loccount.sh
# Pretty prints the total added, removed, and contributed lines of code for a given user
# in a git repository.
#
# Arguments:
# $1 - username
# $2 - directory to check
@keeferrourke
keeferrourke / JvmAccessModifiers.kt
Created June 5, 2019 16:08
Make some sense of JVM access modifiers
import org.objectweb.asm.Opcodes
data class AccessModifier(val code: Int, val name: String)
enum class ClassPart {
CLASS,
METHOD,
FIELD,
MODULE,
MODULE_REQUIRES
@keeferrourke
keeferrourke / gitqstats.sh
Last active December 7, 2018 01:44
Quick script that generates some pretty stats about a git repository on a quarter-by-quarter basis. Written for some basic analysis of our many repositories over at https://rightmesh.io
#!/usr/bin/env bash
# exit codes
EX_OK=0
EX_ERR=1
EX_USAGE=64
# default argument values
since_year=2015
until_year=$(date +%Y)
@keeferrourke
keeferrourke / latexcompile
Created May 28, 2018 04:03
Simple bash script to compile a LaTeX document with pdflatex, and clean up auxillary output files.
#!/bin/bash
#
# latexcompile
# Keefer Rourke <mail@krourke.org>
#
# To the extent possible under law, the person who associated CC0 with
# latexcompile has waived all copyright and related or neighboring rights
# to latexcompile.
#
# See <http://creativecommons.org/publicdomain/zero/1.0/> for a copy of