Skip to content

Instantly share code, notes, and snippets.

View quad's full-sized avatar

Scott Robinson quad

View GitHub Profile
@quad
quad / Code.gs
Created October 28, 2020 03:50
Block out my work calendar with my personal events
function hashify(hash, [key, value]) {
hash[key] = value;
return hash;
}
function eventId(event) {
if (event.isRecurringEvent()) {
return event.getId() + "-" + event.getStartTime().toISOString() + "-" + event.getEndTime();
}
@quad
quad / fix.py
Last active August 12, 2020 14:21
OPERATORS = "+-"
def simplify_parens(expr):
"""
Remove all unnecessary parenthesis for a simple algebra-like string. It maintains the brackets, so any operator can be swapped for any other and the resulting expression will have the same results before and after parenthesis reduction.
>>> simplify_parens('a')
'a'
>>> simplify_parens('a + b')
@quad
quad / usaa_to_ledger.py
Last active January 23, 2020 18:25
Convert USAA Bank Statements to Ledger Transactions
import datetime
import enum
import re
import sys
import types
from collections import namedtuple
from decimal import Decimal
from operator import attrgetter
@quad
quad / Makefile
Last active January 22, 2019 16:15
Make macOS (OSX) Greyscale from the terminal (CLI)
tgray: tgray.c
clang -g -std=c11 -Wall -framework ApplicationServices $^ -o $@
@quad
quad / runtext.sh
Last active September 11, 2018 11:49
Things: My Consumer Lifestyle, Enumerated
#!/bin/sh
# The most important line in any shell program.
#
# Sometimes, though, I wish it worked in the [shebang][].
set -e
file="$1"
@quad
quad / Makefile
Last active August 3, 2018 03:16
Find a cycle in a linked list, for all your tech interview problem needs.
CFLAGS=-Wall -Wextra -Werror -std=c99 -O
all: cycle
./cycle
cycle: cycle.c
@quad
quad / multi-browser.vala
Created May 26, 2009 15:35
Minimal WebKit browser examples in Vala
using GLib;
using Gtk;
using WebKit;
public class Browser : Window {
private const string URL = "http://mixtape.quadhome.com/6/";
private Notebook notebook;
public Browser() {
@quad
quad / keybase.md
Created April 11, 2017 02:06
Keybase Proof

Keybase proof

I hereby claim:

  • I am quad on github.
  • I am quad (https://keybase.io/quad) on keybase.
  • I have a public key ASBxDFR1P5fGthosSBX-iUd18uAFSCpNZdqCY0yE0QaPvQo

To claim this, I am signing this object:

@quad
quad / dci_bench.rb
Last active April 3, 2017 09:59
Because Rubyists knows the value of everything, but the cost of nothing.
require 'benchmark'
require 'delegate'
class Direct
def method
'direct'
end
def base
'base'
@quad
quad / zoe-text.html
Created April 3, 2017 09:55
An incomplete labour of impermanent love
<html>
<meta charset="utf-8" />
<style>
body { background-color: white; margin: auto; text-align: center; }
p { writing-mode: vertical-rl; }
span { font-size: 3vh; }
#off { color: white };
</style>