Skip to content

Instantly share code, notes, and snippets.

@quad
quad / hey.rb
Created Dec 8, 2012
hey! a minimalist CRM
View hey.rb
#!/usr/bin/env ruby
#
# hey! a minimalist CRM for http://todotxt.com/
#
# hey tells you one thing you should do regularly, but haven't done lately.
#
# $ todo.sh lf hey
# 1 @phone Mom (+1 234 567 8901) +family
# 2 @skype Dad +family
# 3 @email mentor
@quad
quad / Code.gs
Created Oct 28, 2020
Block out my work calendar with my personal events
View Code.gs
function hashify(hash, [key, value]) {
hash[key] = value;
return hash;
}
function eventId(event) {
if (event.isRecurringEvent()) {
return event.getId() + "-" + event.getStartTime().toISOString() + "-" + event.getEndTime();
}
View fix.py
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 Jan 23, 2020
Convert USAA Bank Statements to Ledger Transactions
View usaa_to_ledger.py
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 Jan 22, 2019
Make macOS (OSX) Greyscale from the terminal (CLI)
View Makefile
tgray: tgray.c
clang -g -std=c11 -Wall -framework ApplicationServices $^ -o $@
@quad
quad / runtext.sh
Last active Sep 11, 2018
Things: My Consumer Lifestyle, Enumerated
View runtext.sh
#!/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 Aug 3, 2018
Find a cycle in a linked list, for all your tech interview problem needs.
View Makefile
CFLAGS=-Wall -Wextra -Werror -std=c99 -O
all: cycle
./cycle
cycle: cycle.c
@quad
quad / multi-browser.vala
Created May 26, 2009
Minimal WebKit browser examples in Vala
View multi-browser.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 Apr 11, 2017
Keybase Proof
View keybase.md

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 Apr 3, 2017
Because Rubyists knows the value of everything, but the cost of nothing.
View dci_bench.rb
require 'benchmark'
require 'delegate'
class Direct
def method
'direct'
end
def base
'base'