This file contains hidden or 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 user_timeline(uid) | |
- request(:get, "/statuses/user_timeline.json", {'user_id' => uid, 'count' => 100, 'trim_user' => true}) | |
+ request(:get, "/statuses/user_timeline.json", | |
+ user_id: uid, | |
+ count: 100, | |
+ trim_user: true, | |
+ include_rts: 1 | |
+ ) | |
end |
This file contains hidden or 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
/usr/bin/firefox -new-tab $1 |
This file contains hidden or 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
Pry.config.editor = "gvim --remote-silent" | |
Pry.hooks.add_hook(:after_session, :say_bye) do | |
puts "fuck off Gnida" | |
end | |
Pry.prompt = [Proc.new{ |obj, nest_level| "#{RUBY_VERSION}-#{RUBY_PATCHLEVEL} (#{obj}):#{nest_level} > " }, | |
Proc.new{ |obj, nest_level| "#{RUBY_VERSION} (#{obj}):#{nest_level} * " } ] | |
This file contains hidden or 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
development: &dev | |
host: | |
- 127.0.0.1 | |
27017 | |
- 0.0.0.0 | |
27017 | |
database: queue |
This file contains hidden or 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
json = { | |
:as_of => @search.until.in_time_zone.xmlschema | |
} | |
if @updates.max_distance | |
json[:next_offset] = @search.next_offset | |
json[:distance] = @updates.max_distance | |
end | |
json[:updates] = @updates.map do |el| |
This file contains hidden or 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
class << Marshal | |
def load_with_rails_classloader(*args) | |
begin | |
load_without_rails_classloader(*args) | |
rescue ArgumentError, NameError => e | |
if e.message =~ %r(undefined class/module) | |
const = e.message.split(' ').last | |
const.constantize | |
retry | |
else |
This file contains hidden or 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
Scenario: Get List of My Hitchhiking Items via API | |
Given the existing things: | |
|name| | |
|The Guide (duh)| | |
|A towel| | |
|Sub-Etha Sens-O-Matic| | |
|Pan Galactic Gargle Blaster| | |
|Kill-o-Zap blaster pistol| | |
And the existing accounts: | |
|email|name|password| |
This file contains hidden or 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
class Comment < ActiveRecord::Base | |
belongs_to :post | |
def create_or_update | |
super | |
rescue ActiveRecord::InvalidForeignKey => e | |
e.message =~ /REFERENCES `([^`]*)`/ | |
errors[:"#{$1}"] = 'Foreign Key Constraint Failed' | |
false | |
end |
This file contains hidden or 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
class Location < ActiveRecord::Base | |
searchable do | |
integer :id | |
spellchk :name | |
latlon :lat | |
latlon :lon | |
string :geohash | |
end | |
class << self |