Skip to content

Instantly share code, notes, and snippets.

class SupportGroup < ActiveRecord::Base
# Define valid language options for validations below
languages = %w(en es)
# Repeat valid languages for use outside this file with @support_group.languages
def languages
%w(en es)
end
validates :language, :inclusion => { :in => languages }
# In Gemfile...
group :development do
gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'
end
group :production do
gem 'mysql2'
end
@tjschuck
tjschuck / gist:1152573
Created August 17, 2011 20:47
Local REE Settings
export RUBY_HEAP_FREE_MIN=100000
export RUBY_HEAP_MIN_SLOTS=600000
export RUBY_HEAP_SLOTS_INCREMENT=300000
export RUBY_GC_MALLOC_LIMIT=50000000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
@tjschuck
tjschuck / gist:5128149c8525269ad666
Created June 27, 2014 03:23
Lossy network aliases
# Lossy local network
alias lossy='sudo ipfw pipe 1 config bw 10bits && sudo ipfw add 10 pipe 1 tcp from any to me 80'
alias halflossy='sudo ipfw pipe 2 config bw 2000bits && sudo ipfw add 10 pipe 2 tcp from any to me 80'
alias delossy='sudo ipfw delete 10'

Keybase proof

I hereby claim:

  • I am tjschuck on github.
  • I am tjschuck (https://keybase.io/tjschuck) on keybase.
  • I have a public key whose fingerprint is 3F3D 0091 1836 6DA9 912E 335C 4C50 5364 CDB0 6BF3

To claim this, I am signing this object: