Skip to content

Instantly share code, notes, and snippets.

View keeferrourke's full-sized avatar
🎯
Focusing

Keefer Rourke keeferrourke

🎯
Focusing
View GitHub Profile
@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
@keeferrourke
keeferrourke / flac2opus
Last active February 26, 2024 19:26
This is a script to convert all flac files in a given directory to ogg/opus. I wrote this because mp3 kinda sucks and opus is a free format that is pretty much taking over the internet.
#!/bin/bash
# Copyright 2017 Keefer Rourke <mail@krourke.org>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCNUMBERLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
@keeferrourke
keeferrourke / how-i-take-notes.md
Last active February 5, 2024 22:07
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 / install-google-fonts.sh
Last active May 22, 2023 12:38
A bash script to install all Google Fonts, system wide, on debian based systems (ex. Ubuntu)
#!/bin/sh
# Written by: Keefer Rourke <https://krourke.org>
# Based on AUR package <https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ttf-google-fonts-git>
# dependancies: fonts-cantarell, ttf-ubuntu-font-family, git
sudo apt-get install fonts-cantarell ttf-ubuntu-font-family git
srcdir="/tmp/google-fonts"
pkgdir="/usr/share/fonts/truetype/google-fonts"
giturl="git://github.com/google/fonts.git"
******** pts/6 ***.***.***.*** Mon Dec 7 20:48 - 23:04 (02:16)
******** pts/0 ***.***.***.*** Mon Dec 7 20:04 - 22:10 (02:05)
******** pts/7 ***.***.***.*** Mon Dec 7 19:14 - 20:17 (01:02)
******** pts/9 ***.***.***.*** Mon Dec 7 18:16 - 19:41 (01:24)
******** pts/8 ***.***.***.*** Mon Dec 7 18:09 - 20:14 (02:04)
******** pts/7 ***.***.***.*** Mon Dec 7 17:38 - 17:39 (00:00)
******** pts/6 ***.***.***.*** Mon Dec 7 16:50 - 20:00 (03:10)
******** pts/6 ***.***.***.*** Mon Dec 7 16:22 - 16:28 (00:06)
******** pts/6 ***.***.***.*** Mon Dec 7 16:22 - 16:22 (00:00)
******** pts/7 ***.***.***.*** Mon Dec 7 15:21 - 15:24 (00:02)
@keeferrourke
keeferrourke / Makefile
Last active November 20, 2020 21:49
Generic Makefile
# Generic makefile for a C project
# Written by Keefer Rourke <mail@krourke.org>
#
# This file is Public Domain or, in places where public domain works
# are not recognized, licensed as CC0. Legal text:
# <https://creativecommons.org/publicdomain/zero/1.0/legalcode.txt>
#
# This Makefile should not rely and any GNU-specific functionality,
# though it is based on the GNU make documentation which is available
# at: <https://www.gnu.org/software/make/manual/make.html>
@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'