Skip to content

Instantly share code, notes, and snippets.

View quad's full-sized avatar
🏴‍☠️

Scott Robinson quad

🏴‍☠️
View GitHub Profile
@quad
quad / hey.rb
Created December 8, 2012 19:04
hey! a minimalist CRM
#!/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 / lr.c
Created October 31, 2012 02:24
Local Register
#include <arpa/inet.h>
#include <errno.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <dns_sd.h>
void callback(DNSServiceRef sdRef,
@quad
quad / pecha.rb
Created August 10, 2012 05:51
Discrimination made easy!
NUM_POOLS = 5
Grad = Struct.new :name, :gender, :region
def norm_name first, last
"#{first.strip} #{last.strip}"
end
def norm_gender gender
{'M' => 'Male', 'F' => 'Female'}[gender] || gender
@quad
quad / lockit.sh
Created June 29, 2012 09:32
Achtung: a not very nice hotdog
#!/bin/sh
#
# We have a few repeat customers here at the TWU 27 hotdog shack.
#
# They've decided it's FUN to visit our stand.
#
# So, we've cooked up something a little special for our valued customers.
set -e
@quad
quad / tie.js
Created May 27, 2012 21:45
Retarded simple event-binding "DSL"
/*
Retarded simple event-binding "DSL"
Best with:
* jQuery (or Zepto)
* event_emitter
https://github.com/ajaxorg/ace/blob/master/lib/ace/lib/event_emitter.js
Usage:
tie($(window), "hashchange")
@quad
quad / aussie-models.py
Created May 2, 2012 12:09
Blonde, brunette, redhead...
#
# The hair colors of Australian fashion models
#
import json
import re
import urllib.request
API = 'http://en.wikipedia.org/w/api.php?%s'
@quad
quad / example-spec.rb
Created April 20, 2012 08:52
RSpec vs. Cucumber
Describe "Logging In" do
Context "Successful Login" do
before do
User.create(:username => "Scott", :password => "Tiger")
visit :login_page
on_page_with(:login_form) do |login_form|
login_form.login("Scott", "Tiger")
end
end
@quad
quad / buildlight.rb
Created March 21, 2012 02:59
blinky configuration
#!/usr/bin/env ruby
require 'rubygems'
require 'blinky'
l = Blinky.new.light
module Blinky
module GoCiServer
def get_server_locations
@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 / find-fucked-specs.sh
Created November 1, 2011 03:12
YO DAWG I HERD U LIKE ORDER-DEPENDENT TESTS?
#!/bin/sh
#
# YO DAWG I HERD U LIKE ORDER-DEPENDENT TESTS?
#
# SO I PUT ORDER-DEPENDENT EXAMPLES N UR ORDER-DEPENDENT SPECS
# SO U CAN B NON-DETERMINISTIC WHILE UR NON-DETERMINISTIC
#
# http://memegenerator.net/instance/11059517
function die () {