I hereby claim:
- I am baldwindavid on github.
- I am baldwindavid (https://keybase.io/baldwindavid) on keybase.
- I have a public key whose fingerprint is 4F3A C424 8315 8EF6 3CC5 DCF1 E130 F0B0 D0D2 73C2
To claim this, I am signing this object:
| require 'rubygems' | |
| require 'net/http' | |
| require 'uri' | |
| require 'json' | |
| require 'cgi' | |
| # Get a free API key at https://words.bighugelabs.com/account/getkey | |
| API_KEY = '[YOUR API KEY HERE]' | |
| API_VERSION = 2 | |
| WORDS_PER_LINE = 4 |
I hereby claim:
To claim this, I am signing this object:
| class DependentPresenceValidator < ActiveModel::EachValidator | |
| def validate_each(record, attribute, value) | |
| dependents = [options[:dependents]].flatten | |
| dependents.each do |dependent| | |
| unless record.send(dependent).present? | |
| record.errors.add dependent, "must not be blank when #{attribute.to_s.humanize} is present." | |
| end |
| alias g="git" | |
| # Log | |
| alias gl="gitx" | |
| # Commit: Prepare Commit in Gitx (run gitx first to refresh) | |
| alias gc="gitx; gitx -c" | |
| # Checkout branch | |
| alias gco="g checkout" |
| if ($.browser.msie && $.browser.version == 7) { | |
| $(function() { | |
| var zIndexNumber = 1000; | |
| $("div").each(function() { | |
| $(this).css('zIndex', zIndexNumber); | |
| zIndexNumber -= 10; | |
| }); | |
| }); | |
| } |
| require 'rubygems' | |
| require 'net/http' | |
| require 'uri' | |
| require 'json' | |
| require 'cgi' | |
| # 1) Get an api key - http://words.bighugelabs.com/api.php | |
| # 2) Point to the file via bash_profile (e.g. alias thes='ruby ~/whateverpath/thes.rb) | |
| # 3) From command line type... thes dog or thes cool |
| gem 'acts_as_tree' | |
| gem "friendly_id", "~> 4.0.1" |
| def plan | |
| Plan.find(plan_id) | |
| end | |
| def plan=(_plan) | |
| self.plan_id = _plan.id | |
| end |
| class Plan | |
| PLANS = [ | |
| { | |
| :id => 1, | |
| :name => "Individual", | |
| :can_send => true, | |
| :amount => "???", | |
| :interval => "month", | |
| :trial_period_days => 30, |
| class User < ActiveRecord::Base | |
| belongs_to :plan # or however you get your plan - mine is actually not in an AR model | |
| def can_do_cool_thing? | |
| plan.can_do_cool_thing? | |
| end | |
| def can_do_other_cool_thing? | |
| plan.can_do_other_cool_thing? |