This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# so, we had a bug from a line of code doing this: | |
something_that_may_be_symbol_or_str.to_s +"something" | |
# => undefined method `+@' for "something":String | |
# TIL: | |
Derp = Class.new { def +@; puts 'WAT'; end } | |
# => Derp | |
+Derp.new | |
# => WAT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IDDA v0.99b5 config file | |
// IDDA Q2WF cfg v1.3 by Rom | |
// See comments for more info | |
// All games | |
weapon 0 "all weapons" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# link_to 'profile', new_or_edit_path(@profile) | |
def new_or_edit_path(resource) | |
resource_name = resource.class.name.underscore | |
resource ? __send__("edit_#{resource_name}_path", resource) : __send__("new_#{resource_name}_path") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def to_param | |
fields = [self.company, self.executive_first_name, self.executive_last_name].compact | |
fields.map! &:parameterize | |
[self.id, *fields].join('-') | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def show | |
begin | |
month = Date.parse(params[:month]) | |
rescue | |
flash[:error] = 'Invalid date.' | |
redirect_to admin_reports_path and return | |
end | |
@auctions = Auction.completed.where("updated_at > ? and updated_at <= ?", month, month.end_of_month) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
└─[$]> ping google.com | |
PING google.com (74.125.137.100): 56 data bytes | |
Request timeout for icmp_seq 0 | |
Request timeout for icmp_seq 1 | |
64 bytes from 74.125.137.100: icmp_seq=0 ttl=48 time=2215.786 ms | |
Request timeout for icmp_seq 3 | |
64 bytes from 74.125.137.100: icmp_seq=1 ttl=48 time=3850.339 ms | |
64 bytes from 74.125.137.100: icmp_seq=2 ttl=48 time=2953.793 ms | |
Request timeout for icmp_seq 6 | |
64 bytes from 74.125.137.100: icmp_seq=3 ttl=48 time=4572.678 ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ENV['BONSAI_INDEX_URL'] | |
Tire.configure do | |
url "http://index.bonsai.io" | |
end | |
BONSAI_INDEX_NAME = ENV['BONSAI_INDEX_URL'][/[^\/]+$/] | |
else | |
app_name = Rails.application.class.parent_name.underscore.dasherize | |
app_env = Rails.env | |
BONSAI_INDEX_NAME = "#{app_name}-#{app_env}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):001:0> directions = %w[DESC ASC] | |
=> ["DESC", "ASC"] | |
irb(main):002:0> directions.instance_eval { def toggle(direction); self - [direction]; end } | |
=> nil | |
irb(main):003:0> directions.toggle('ASC') | |
=> ["DESC"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'linkedin' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.autocomplete { | |
z-index: 10020; | |
position: absolute; | |
background: rgba(255,255,255,0.9); | |
width: 205px; | |
font-family: "Helvetica Neue", "Helvetica", Arial, sans-serif; | |
font-size: 14px; | |
color: #000; | |
border: 1px solid #b4becd; | |
-moz-box-shadow: 0 1px 2px rgba(0,0,0,0.2); |