Skip to content

Instantly share code, notes, and snippets.

View penso's full-sized avatar

Fabien Penso penso

View GitHub Profile
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:3061:in `execute_callstack_for_multiparameter_attributes'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:3022:in `assign_multiparameter_attributes'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:2749:in `attributes='
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:2627:in `update_attributes'
app/controllers/users_controller.rb:164:in `update'
Request
Parameters:
Time.zone>> Time.zone
=> #<ActiveSupport::TimeZone:0x7fca81c99548 @utc_offset=0, @name="UTC", @tzinfo=nil>
>> Time.zone="Paris"
=> "Paris"
>> Time.zone
=> #<ActiveSupport::TimeZone:0x7fca81c99318 @utc_offset=3600, @name="Paris", @tzinfo=nil>
>> User.first.silent_mode_at
=> Sat Jan 01 22:00:00 UTC 2000
>> Time.zone="Hawaii"
=> "Hawaii"
>> u.created_at
=> Sun, 07 Jun 2009 07:01:47 UTC +00:00
>> Time.zone
=> #<ActiveSupport::TimeZone:0x7fb17a57cf00 @utc_offset=0, @name="UTC", @tzinfo=#<TZInfo::DataTimezone: Etc/UTC>>
>> Time.zone = "Paris"
=> "Paris"
>> u.created_at
=> Sun, 07 Jun 2009 07:01:47 UTC +00:00
★★★ Delivering real-time content to your iPhone ★★★
Including push for: Twitter, Facebook, GMail, RSS, and more! We also support
multiple accounts, and we do not consume your Twitter API calls.
Notifications is an iPhone app that acts as a client for the Apple Push
Notification Service.
Use our ready-made Twitter, Gmail, Mail and RSS notification services to instantly
receive new tweets, search results, emails, RSS feeds, or create your own
class UserFacebookPublisher < Facebooker::Rails::Publisher
# For changing user's feed (wall)
def review_feed_template
one_line_story_template "{*actor*} {*action*} {*game*}."
short_story_template "{*actor*} {*action*} {*game*}.","{*text*}"
end
def review_feed(review)
send_as :user_action
from review.user.facebook_session.user
<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<updated>2009-11-04T23:29:58+00:00</updated>
<id>http://blog.monopolycitystreets.com/feeds/posts/default</id>
<link href="http://blog.monopolycitystreets.com/feeds/posts/default" rel="self"/>
<entry>
<title>Yesterday's updates</title>
<id>tag:blogger.com,1999:blog-8660921731558571169.post-703119497809008501</id>
<published>2009-10-27T14:27:00+00:00</published>
<content>&lt;!--StartFragment--&gt;&lt;span style="font-family:Arial;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;As you likely noticed, we took the game off line for some time yesterday to implement a few updates. As part of our ongoing effort to continuously improve game play, we added an update to correct inconsistent data relating to streets involved in offers. This should correct the problem that some were seeing about streets appearing to be owned by one player when in fact should have been released to another player.&lt;br /&gt;&lt;br
@penso
penso / gist:262598
Created December 23, 2009 16:03
code sample for EM and Oauth
WORKING With Net:Http :
def twitter_oauth_consumer
@consumer ||= OAuth::Consumer.new(APP_CONFIG['twitter_consumer_key'],APP_CONFIG['twitter_consumer_secret'],{ :site=>"http://twitter.com" })
@consumer
end
def twitter_oauth_token
@token ||= OAuth::AccessToken.new(self.twitter_oauth_consumer, oauth_token, oauth_secret)
@token
curl RAILS_WEBSITE -d"foobar=foo=bar&foo2=bar2"
result :
Parameters: {"format"=>"html", "foo2"=>"bar2", "foobar"=>"foo=bar", "controller"=>"controller"}
Instead of {'foobar' => 'foo=bar&foo2=bar2'}
curl RAILS_WEBSITE -d"foobar=foo=bar&amp;foo2=bar2"
desc SELECT title FROM `notifications` WHERE (user_id = 1 AND id < '5433214') ORDER BY notifications.id DESC LIMIT 0, 25;
+----+-------------+---------------+-------------+----------------------------------------+----------------------------------------+---------+------+------+--------------------------------------------------------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+---------------+-------------+----------------------------------------+----------------------------------------+---------+------+------+--------------------------------------------------------------------------------------+
| 1 | SIMPLE | notifications | index_merge | PRIMARY,index_notifications_on_user_id | index_notifications_on_user_id,PRIMARY | 5,4 | NULL | 9357 | Using interse
#!/usr/bin/env ruby
require 'rubygems'
require 'eventmachine'
require 'em-http'
require 'json'
path = "/2b/user.json"
host = "betastream.twitter.com"
url = "http://#{host}#{path}"