Skip to content

Instantly share code, notes, and snippets.

View noahhendrix's full-sized avatar

Noah Hendrix noahhendrix

View GitHub Profile
@noahhendrix
noahhendrix / 2014-oscar-predictions.md
Last active December 14, 2015 03:59
Oscar Predictions

✗ Best Picture

Lincoln

✓ Best Actor in a Leading Role

Daniel Day-Lewis (Lincoln)

✗ Best Actress in a Leading Role

Quvenzhané Wallis (Beasts of the Southern Wild)

✓ Best Director

@noahhendrix
noahhendrix / README.md
Created August 22, 2013 01:18
New Computer

Apps

  1. Dropbox
  2. 1Password
  3. Alfred
@noahhendrix
noahhendrix / bulk.rb
Last active December 26, 2015 08:29
Alternative to RubyTapas #144
require 'securerandom'
codes = Array.new(200) { SecureRandom.hex(8) } # => ["de988ab34e9ac058", "423198812a0152ad", … ]
module Filterable
extend ActiveSupport::Concern
module ClassMethods
def filter(filtering_params)
filtering_params.reduce(self) do |relation, (scope_name, value)|
relation.public_send(scope_name, value) if value.present?
end
end
end