Skip to content

Instantly share code, notes, and snippets.

View afair's full-sized avatar

Allen Fair afair

View GitHub Profile

Keybase proof

I hereby claim:

  • I am afair on github.
  • I am allenfair (https://keybase.io/allenfair) on keybase.
  • I have a public key whose fingerprint is F00B 3ED2 5CE8 F9AF 3D4A 55D9 1651 1D53 10AE 1388

To claim this, I am signing this object:

@afair
afair / http-rest-api-notes.md
Created May 13, 2014 19:13
REST, HTTP, JSON-API Protocol Notes

REST, HTTP, JSON-API Protocol Notes

Resources (URL):

Collection of Data Objects

  • /dataname (logical viewname (preferred), record name, table name)
  • /parent/id/children

Data Object

@afair
afair / straight-up-rspec-3.rb
Last active August 29, 2015 14:04
Notes from: Straight Up RSpec 3 - a neat Ruby BDD Tool
################################################################################
# Notes from: Straight Up RSpec 3 - a neat Ruby BDD Tool
#-------------------------------------------------------------------------------
# From: http://www.slideshare.net/gsterndale/straight-up-rspec-3
# By: Greg Sterndale
################################################################################
# .rspec
# lib/…
# spec/spec_helper.rb
@afair
afair / rubyref.rb
Last active August 29, 2015 14:04
Ruby Reference by Examples
module MyModule
def module_method
end
end
class RubyRef < BaseClass
include MyModule
attr_reader :a
attr_writer :b
attr_accessor :c
@afair
afair / nokogiri-freebsd-install.sh
Created December 5, 2014 16:11
Install Nokogiri on FreeBSD
#!/bin/sh
gem install nokogiri -- \
--use-system-libraries \
--with-xml2-lib=/usr/local/lib \
--with-xml2-include=/usr/local/include/libxml2/libxml \
--with-xslt-lib=/usr/local/lib \
--with-xslt-include=/usr/local/include/libxslt \
--with-iconv-lib=/usr/local/lib \
--with-iconv-include=/usr/local/include
@afair
afair / brew-install-php53.sh
Last active January 27, 2017 12:07
Install PHP 5.3 on Apache 2.4 on OS X 10.10 Yosemite
#!/bin/sh
brew tap homebrew/dupes
brew install zlib
brew tap homebrew/php
brew install php53 --with-pgsql
# Troubleshooting...
#% php -v ~/src/guacamole
#dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.54.dylib
@afair
afair / example_spec.rb
Created March 3, 2015 15:55
RSpec3 Template Spec and Reference by Example
require 'spec_helper'
describe Widget do
# Setup, Exercise, Verify, Teardown!
describe '#instance_method' do
subject { buid_stubbed(:widget) }
it 'works' do
expect(subject.name).to be_nil
@afair
afair / partition.sql
Created July 14, 2015 20:08
PostgreSQL Partitioned Table Example Usage
drop table if exists data cascade;
create table data (
id uuid not null default uuid_generate_v4(),
month integer not null,
data json not null);
drop table if exists data_201501;
create table data_201501 (
check ( month = 201501 )
) inherits (data);
@afair
afair / passenger-install-apache2-module.log
Created August 25, 2015 16:55
passenger-install-apache2-module, versions 5.0.9 through 5.0.16, Failure :-(
allen@dev2 % uname -a ~
FreeBSD dev2.xxx.com 8.4-RELEASE-p9 FreeBSD 8.4-RELEASE-p9 #13 r265131: Wed Apr 30 02:18:42 EDT 2014 [email protected]:/usr/obj/usr/src/sys/DEVEL4 amd64
allen@dev2 % ruby -v ~
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-freebsd8.4]
allen@dev2 [1] % passenger-install-apache2-module ~
Welcome to the Phusion Passenger Apache 2 module installer, v5.0.16.
This installer will guide you through the entire installation process. It
@afair
afair / passenger-install-apache2-module-5.0.8.log
Last active August 29, 2015 14:28
passenger-install-apache2-module, versions 5.0.8 Success! :-)
allen@dev2 % passenger-install-apache2-module ~
Welcome to the Phusion Passenger Apache 2 module installer, v5.0.8.
This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.
Here's what you can expect from the installation process:
1. The Apache 2 module will be installed for you.
2. You'll learn how to configure Apache.