Skip to content

Instantly share code, notes, and snippets.

Tate Johnson tatey

Block or report user

Report or block tatey

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
View ruby_example.rb
class RubyExample
CONSTANT = /^[0-9]+ regex awesomes$/
attr_reader :colorscheme
def initialize(attributes = {})
@colorscheme = attributes[:colorscheme]
def self.values
View option_a.rb
class Page < ActiveRecord::Base
has_attached_file :image, sizes: {small: '10x10', large: '100x100'}
has_attached_file :uploaded_image
def safe_image_url
if image
View after.rb
module Publishers
class HTTP
attr_accessor :key
attr_reader :hosts
def initialize attributes = nil
attributes ||= {}
self.event = attributes[:event]
self.hosts = attributes.fetch(:hosts) do
View gist:2557125
require 'test_helper'
class PayPalExpress::TransactionSearchTest < ActiveSupport::TestCase
test "#search returns a collection of transactions" do
account =
period =
requester =
params = {}
params['ACK'] = 'Success'
params.default = []
View gist:325083
def get_options(args)
args.inject({}) do |args, arg|
if arg =~ /^--(\S+)$/
key, value = $1.split('=')
args[key] = value.nil? || value
elsif arg =~ /^-(no-?)(\S+)/
if $1 == "no-"
args[$2] = false
args[$1] = true
View gist:325073
def get_options(args)
args.inject({}) do |args, arg|
if arg =~ /^--(\w+)/
key, value = $1.split('=')
args[key] = value
elsif arg =~ /^-(\w+)/
options[$1.match(/(\w+)$/)[1]] = !$1.match(/^no-/)
View gist:297142
// Set API Key
var flickr = $.flickr('123');
// Request instance by invoking flickr service method
var recent ={
size: 's'
page: 1,
beforeSend: function() {
View IE7 negative margin float bug WTF.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html lang='en-US' xml:lang='en-US' xmlns=''>
<title>IE float bug</title>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
<style type='text/css'>
body {
font-family: Helvetica, sans-serif; }
#container, #left, #right1, #right2 {
You can’t perform that action at this time.