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 / keybase.md
Last active November 29, 2017 12:39
Keybase authentication

Keybase proof

I hereby claim:

  • I am keeferrourke on github.
  • I am krourke (https://keybase.io/krourke) on keybase.
  • I have a public key ASAZ_FRl1jykR2lt8ZfCra7NvkslCSZS7wqtJD1nnYNIWgo

To claim this, I am signing this object:

@keeferrourke
keeferrourke / bin-reflected-graycode.go
Created December 15, 2017 15:57
This is a simple program to generate and print the binary reflected Gray code for n-digits. Supply "n" as the single argument when calling the program.
package main
import (
"fmt"
"log"
"os"
"strconv"
)
func grayCode(seed []string, len int) []string {
@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 / userChrome.css
Created May 20, 2018 21:43
User chrome styling to move window controls to the left for Firefox 60+ CSD on Linux
/* place in $HOME/.mozilla/firefox/<default profile>/chrome/
* you may need to create this directory
*
* credit goes to this answer on Ask Ubuntu https://askubuntu.com/questions/1035428/firefox-60-csd-window-buttons-left
*/
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
#titlebar-max {
-moz-box-ordinal-group: 0;
}
@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 / .clang-format
Last active June 5, 2019 16:09
Easily accessible clang-format rules for my own sanity
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
@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 / 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 / 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 / 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