Skip to content

Instantly share code, notes, and snippets.

View jpemberthy's full-sized avatar

Juan Pemberthy jpemberthy

View GitHub Profile
latas = Lata.find(:all, :params => {:city => 'Los Angeles'})
=> [#<Lata:0x201fea8 @prefix_options={}, @attributes={"city"=>"Bahia de los Angeles", "id"=>1269, "state"=>"Baja California Norte"}>, #<Lata:0x201fe30 @prefix_options={}, @attributes={"city"=>"Glendale/Los Angeles", "id"=>6401, "state"=>"CA"}>, #<Lata:0x201f4e4 @prefix_options={}, @attributes={"city"=>"Los Angeles", "id"=>2323, "state"=>"CA"}>, #<Lata:0x201c1b8 @prefix_options={}, @attributes={"city"=>"Los Angeles", "id"=>7960, "state"=>"Biobio"}>, #<Lata:0x201aa5c @prefix_options={}, @attributes={"city"=>"Los Angeles", "id"=>7961, "state"=>"Biobio"}>, #<Lata:0x2019b20 @prefix_options={}, @attributes={"city"=>"Los Angeles", "id"=>7962, "state"=>"Biobio"}>, #<Lata:0x20197d8 @prefix_options={}, @attributes={"city"=>"Los Angeles", "id"=>2331, "state"=>"CA"}>, #<Lata:0x2019490 @prefix_options={}, @attributes={"city"=>"Los Angeles", "id"=>7963, "state"=>"Biobio"}>, #<Lata:0x2019148 @prefix_options={}, @attributes={"city"=>"Los Angeles", "id"=>2334, "stat
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: mysql
database: mertd_development
user: root
password:
timeout: 5000
# Warning: The database defined as "test" will be erased and
sc
Loading development environment (Rails 2.2.2)
>> scope = 'http://gdata.youtube.com'
=> "http://gdata.youtube.com"
>> next_url = 'http://example.com/change/to/your/app'
=> "http://example.com/change/to/your/app"
>> secure = false
=> false
>> session = true
=> true
User.find(1208)
ActiveResource::UnauthorizedAccess Exception: Failed with 401 Unauthorized
log
Processing UsersController#show to xml (for 127.0.0.1 at 2009-05-16 11:59:39) [GET]
Parameters: {"id"=>"1208"}
SQL (0.1ms) SET SQL_AUTO_IS_NULL=0
ApiClient Columns (1.4ms) SHOW FIELDS FROM `api_clients`
user.save
ArgumentError Exception: expected an attributes Hash, got #<User::CallSetting:0x3bf0934 @prefix_options={}, @attributes={"phone_type"=>nil, "phone_carrier"=>nil, "validation_code"=>nil, "updated_at"=>Sat May 16 16:19:19 UTC 2009, "number"=>"3016100640", "id"=>1208, "time_out"=>nil, "user_id"=>1208, "position"=>0, "phone_validated_at"=>nil, "created_at"=>Sat May 16 16:19:19 UTC 2009}>
TIME_ZONES = [
["(GMT-11:00) Midway Island", "Pacific/Midway"],
["(GMT-11:00) Samoa", "US/Samoa"],
["(GMT-10:00) Hawaii", "US/Hawaii"],
["(GMT-09:00) Alaska", "AST"],
["(GMT-08:00) Pacific Time (US & Canada)", "US/Pacific"],
["(GMT-07:00) Mountain Time (US & Canada)", "US/Mountain"],
["(GMT-06:00) Central America", "US/Central"],
["(GMT-06:00) Mexico City", "America/Mexico_City"],
["(GMT-06:00) Monterrey", "America/Monterrey"],
#!/usr/bin/env ruby
require File.expand_path(File.dirname(__FILE__)) + '/../../config/boot'
rails_root = File.expand_path RAILS_ROOT
ENV["RAILS_ENV"] ||= "production"
Dir.chdir(rails_root) # Change current directory to RAILS_ROOT
require "config/environment" # Start up rails
require 'stock.rb'
describe "responding to GET link_account with VALID Token" do
before do
authenticate_user
#[email protected] long session token => 'CPnEpdnfEhDDnN3RBg'
@client_calendar_contacts = GData::Client::Base.new
@client_calendar_contacts.authsub_token.stub!(:upgrade).and_return(@auth_handler)
@auth_handler.stub!(:upgrade).and_return('CPnEpdnfEhDDnN3RBg')
get :link_account, :token => '666_666_666'
end
describe "responding to GET link_account with VALID Token" do
before do
authenticate_user
controller.stubs(:update_token).returns('valid_token')
#controller.stubs(:current_user).returns(Factory(:user))
get :link_account, :token => 'single_token'
end
it "should redirect_to calendar contact" do
controller.stubs(:current_user).returns(assigns(:current_user))
var twitter = jetpack.lib.twitter
jetpack.statusBar.append({
html: "foooo",
width: 90,
onReady: function(widget){
$(widget).click(function(){
twitter.getTwitLatestStatus( "jpemberthy", function(tweet){
var newTweet = tweet.text;
jetpack.notifications.show( newTweet );
});