Skip to content

Instantly share code, notes, and snippets.

Andrew Smith fullsailor

Block or report user

Report or block fullsailor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

  • I am fullsailor on github.
  • I am fullsailor ( on keybase.
  • I have a public key whose fingerprint is 3BA3 3807 BC0C 043E F1B9 16B3 768E D794 41D2 EEC9

To claim this, I am signing this object:

View heroku-schema.json
"$schema": "",
"definitions": {
"account-feature": {
"description": "An account feature represents a Heroku labs capability that can be enabled or disabled for an account on Heroku.",
"$schema": "",
"stability": "production",
"strictProperties": true,
"title": "Heroku Platform API - Account Feature",
"type": [
View TestFlightSDK.podspec do |s| = 'TestFlightSDK'
s.version = '2.0.2-beta'
s.license = {
:type => 'Commercial',
:text => <<-LICENSE
All text and design is copyright © 2010-2013 TestFlight App, Inc.
All rights reserved.
fullsailor / activity.rb
Created Jul 5, 2012
Polymorphic #where method in ActiveRecord
View activity.rb
class Activity < ActiveRecord::Base
belongs_to :actor, polymorphic: true
belongs_to :thing, polymorphic: true
belongs_to :target, polymorphic: true
def self.polywhere(opts)
t = arel_table
ands = do |assoc, obj|
left_eq = t["#{assoc}_id"].eq(
right_eq = t["#{assoc}_type"].eq(obj.class.model_name)
View new.html.erb
<%= notice %>
<%= render 'form' %>
View post.rb
# == Schema Information
# Table name: posts
# id :integer not null, primary key
# title :string(255)
# content :text
# user_id :integer
# slug :string(255)
# created_at :datetime
View example.rb
class Example < ActiveRecord::Base
set_table_name 'legacy_somethings'
fullsailor / gist:798102
Created Jan 27, 2011
RVM .rvmrc weirdness
View gist:798102
12:06:35am [andrew@mbp]:code
$ cd my_project/
= RVM has encountered a not yet trusted .rvmrc file in the =
= current working directory which may contain nasty code. =
= =
= Examine the contents of this file to be sure the contents =
fullsailor / GoToBillingLibrary.rb
Created Jan 26, 2011
Possibly the worst Ruby code ever written.
View GoToBillingLibrary.rb
# GoToBilling Ruby on Rails Plugin v1.0
# Compatible with version 3.0.2 of the GoToBilling Gateway
require 'net/http'
require 'net/https'
require 'cgi'
module GoToBillingLibrary
View application.js
jQuery(function($) {
// Fallback functionality for HTML5 input placeholder text
if (document.createElement('input').placeholder === undefined) {
You can’t perform that action at this time.