View example_spec.rb
1 2 3 4 5 6 7 8 9 10
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
View brew-install-php53.sh
1 2 3 4 5
#!/bin/sh
brew tap homebrew/dupes
brew install zlib
brew tap homebrew/php
brew install php53 --with-pgsql
View nokogiri-freebsd-install.sh
1 2 3 4 5 6 7 8 9 10
#!/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
View rubyref.rb
1 2 3 4 5 6 7 8 9 10
module MyModule
def module_method
end
end
 
class RubyRef < BaseClass
include MyModule
attr_reader :a
attr_writer :b
attr_accessor :c
View straight-up-rspec-3.rb
1 2 3 4 5 6 7 8 9 10
################################################################################
# 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
View http-rest-api-notes.md

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

View keybase.md

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:

View gist:9648839
1 2 3 4 5 6 7 8 9 10
FactoryGirl.define do
factory :user do # class:User, aliases:[:name1, :name2]
name "Ruby"
date_of_birth { 21.years.ago } # Blocked called lazily at request time
association_factory_name
association :commenter, factory: :user, attrib:"value"
factory(:admin_user) do # Inheritance
admin true
end
View JsonMessages.js
1 2 3 4 5 6 7 8 9 10
var talk = {
 
title: "JSON Messaging: From REST and Beyond",
 
by: { name: "Allen Fair",
twitter: "@allenfair" },
 
event: { organization: "Philly.rb",
when: "August 12, 2013 23:00 UDT",
style: "☇ Lightning" },
View curl reference
1 2 3 4 5 6 7 8 9 10
==========================================
CURL COMMAND
==========================================
 
Format curl [options] [URL...]
 
Quick Ref:
 
curl -X POST http://example.com/ <= Method option and URL (Options come before or after URL)
-H "Authorization: <data>" <= Add HTTP Header (like Authorization)
Something went wrong with that request. Please try again.