Skip to content

Instantly share code, notes, and snippets.

View fullsailor's full-sized avatar

Andrew Smith fullsailor

View GitHub Profile
@fullsailor
fullsailor / keybase.md
Last active August 29, 2015 14:22
keybase.md

Keybase proof

I hereby claim:

  • I am fullsailor on github.
  • I am fullsailor (https://keybase.io/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:

@fullsailor
fullsailor / heroku-schema.json
Created June 25, 2014 19:59
Heroku JSON Schema
{
"$schema": "http://interagent.github.io/interagent-hyper-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": "http://json-schema.org/draft-04/hyper-schema",
"stability": "production",
"strictProperties": true,
"title": "Heroku Platform API - Account Feature",
"type": [
Pod::Spec.new do |s|
s.name = '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
fullsailor / activity.rb
Created July 5, 2012 21:02
Polymorphic #where method in ActiveRecord
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 = opts.map do |assoc, obj|
left_eq = t["#{assoc}_id"].eq(obj.id)
right_eq = t["#{assoc}_type"].eq(obj.class.model_name)
<%= notice %>
<%= render 'form' %>
@fullsailor
fullsailor / post.rb
Created October 15, 2011 03:36 — forked from renz45/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
class Example < ActiveRecord::Base
set_table_name 'legacy_somethings'
end
@fullsailor
fullsailor / gist:798102
Created January 27, 2011 05:10
RVM .rvmrc weirdness
12:06:35am [andrew@mbp]:code
$ cd my_project/
===============================================================
= NOTICE: =
===============================================================
= 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
fullsailor / GoToBillingLibrary.rb
Created January 26, 2011 21:36
Possibly the worst Ruby code ever written.
#------------------------------------------------------------
# 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
jQuery(function($) {
// Fallback functionality for HTML5 input placeholder text
if (document.createElement('input').placeholder === undefined) {
$('input[placeholder]').prompted_text_input().blur();
}
});