Skip to content

Instantly share code, notes, and snippets.

View jcoleman's full-sized avatar

James Coleman jcoleman

  • Braintree Payments
  • Greenville, SC
View GitHub Profile
@jcoleman
jcoleman / puma-init.erb
Last active August 29, 2015 14:02 — forked from ivanxuu/puma.sh
#! /bin/sh
### BEGIN INIT INFO
# Provides: pumacontrol
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Puma web server
### END INIT INFO
@jcoleman
jcoleman / gist:5569537
Last active December 17, 2015 06:59 — forked from pmdarrow/gist:3427827
# These instructions were tested on Ubuntu 12.04 64bit
# Be prepared to wait a while...
sudo apt-get install openssl build-essential xorg libssl-dev libxrender-dev libxext-dev libpq-dev libx11-dev
git clone git://github.com/antialize/wkhtmltopdf.git
git clone git://github.com/jcsalterego/wkhtmltopdf-qt.git
cd wkhtmltopdf
mkdir static-build
ln -s ../wkhtmltopdf-qt static-build/qt
./scripts/static-build.sh
@jcoleman
jcoleman / PCPropertyObserver.h
Last active October 9, 2015 18:08 — forked from pnc/PCPropertyObserver.c
PCPropertyObserver
// © 2011-2014 Phillip N. Calvin, James Coleman
// For use in a setter.
// Signs up self to receive KVO notifications about given properties
// on any new value and removes self as an observer from the old value.
// For example, to observe properties of a property called customer
// (backed by ivar _customer):
// PCPropertyObserver(customer, @"allowSubscriptionPurchase", @"availableProducts");
// You'd need to write this selector yourself:
# The idea here is to emulate Groovy's delegate= pattern for closures.
# We define a builder module. This will receive method calls
# from our builder. It could be an instance of an object if we wanted.
module FamilyBuilder
def self.parent(name)
puts "Parent: #{name}"
end
def self.child(name)