I hereby claim:
- I am rubiety on github.
- I am rubiety (https://keybase.io/rubiety) on keybase.
- I have a public key whose fingerprint is C2B6 4E10 316C 96DA 6218 C7BF 31B1 B5C8 1528 8AF1
To claim this, I am signing this object:
Routing: | |
http://www.gcmap.com/mapui?P=YVR-MUC-FRA-BKK-HKG,HKG-BKK-SYD-AKL,AKL-PVG-NRT-SIN-BKK-NRT-ICN-JFK-LAX | |
Lufthansa First Class, Vancouver to Munich: $10,541 | |
Thai Airways A380 First Class, Frankfurt to Bangkok: $9,610 | |
Thai Airways 747 First Class, Bangkok to Hong Kong: $776 | |
Thai Airways 747 (A380?) First Class, Bangkok to Sydney: $2,989 | |
Air New Zealand Dreamliner Business Class, Auckland to Shanghai: $2,500 | |
ANA Business Class, Shanghai to Tokyo: $1,158 | |
ANA Dreamliner Business Class, Tokyo to Singapore: $3,253 |
I hereby claim:
To claim this, I am signing this object:
» AwardChartEntry.first_class.between(Airport["SAN"], Airport["ICN"]).order("amount asc").map(&:name) | |
=> [ | |
[0] "MileagePlus Mainland U.S., Alaska & Canada to North Asia Saver Award in First: 80000 miles one way on own metal", | |
[1] "Aeroplan Canada & Continental USA to Asia 1 ClassicFlight Award in First: 105000 miles one way", | |
[2] "MileagePlus Mainland U.S., Alaska & Canada to North Asia Saver Award in First: 120000 miles one way on partner metal", | |
[3] "Skypass North America to Korea Off Peak Award in First: 160000 miles round trip", | |
[4] "MileagePlus Mainland U.S., Alaska & Canada to North Asia Standard Award in First: 190000 miles one way on own metal", | |
[5] "MileagePlus Mainland U.S., Alaska & Canada to North Asia Standard Award in First: 190000 miles one way on partner metal", | |
[6] "Aeroplan Canada & Continental USA to Asia 1 ClassicFlight Award in First: 210000 miles round trip", | |
[7] "Skypass North America to Korea Peak Award in First: 240000 miles round trip" |
############################################################# | |
# Application | |
############################################################# | |
set :application, "" #your app's name here | |
set :server_ip, "" #your server's ip here | |
set :deploy_to, "/home/rails/#{application}" #the path to your rails app here | |
############################################################# | |
# Servers |
named_scope :with_keywords, lambda {|q| | |
fields = %w(title information items.sku) | |
tokens = q.split.collect {|c| "%#{c.downcase}%"} | |
clause = (["(" + fields.map {|f| "#{f} LIKE ?" }.join(" OR ") + ")"] * tokens.size).join(" AND ") | |
{ :include => [:items], :conditions => [clause, *(tokens * fields.size).sort] } | |
} |
# If you ever needed an array of all ActiveRecord models in your Rails app (+ Session): | |
Dir["app/models/**/*.rb"].each {|r| require r} | |
subclasses_of(ActiveRecord::Base).map(&:class_name) | |
# Or *all* models: | |
ActiveRecord::Base.connection # Preloads driver constants | |
constants_before = Object.constants | |
Dir["app/models/**/*.rb"].each {|r| require r} | |
Object.constants - constants_before |
class ActivityEntry < ActiveRecord::Base | |
belongs_to :target, :polymorphic => true | |
belongs_to :user | |
# Target Scopes | |
named_scope :for, lambda {|obj| {:conditions => {:target_id => obj.id, :target_type => obj.class.name}} } | |
named_scope :for_listings, {:conditions => {:target_type => 'Listing'} } | |
named_scope :manageable_by, lambda {|user| | |
case | |
when user.can_manage_company? then {} |
indigosun:vim-fu bhughes$ rake preinstall | |
(in /Users/bhughes/Workspace/Source/vim-fu) | |
Usage: /usr/local/git/bin/git-submodule [--quiet] [--cached] [add <repo> [-b branch]|status|init|update|summary [-n|--summary-limit <n>] [<commit>]] [--] [<path>...] |
# Bad: | |
1.upto(10) do |i| | |
puts "X" * i | |
end | |
# Good: | |
((nil.object_id - 3)..(2**3 + 2)).map do |i| | |
lambda { "X" * i } | |
end.collect {|i| i.send(:call)}.tap do |a| | |
puts a.class.instance_method(:join).send(:bind, a).call("\n") |