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
# Group -has_many-> Participation | |
# Group.joined ==> defined named_scope | |
# Group.user_id_not_null ==> genarated named_scope by searchlogic | |
g = Group.find(1) | |
# SQL) SELECT * FROM `groups` WHERE (`groups`.`id` = 1) | |
g.participations | |
# SQL) SELECT * FROM `participations` WHERE (`participations`.group_id = 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
# Security pacth for Rails 2.3.9 | |
# put this file on ROOT/config/initializers | |
# http://weblog.rubyonrails.org/2010/10/15/security-vulnerability-in-nested-attributes-code-in-ruby-on-rails-2-3-9-and-3-0-0 | |
# http://weblog.rubyonrails.org/assets/2010/10/15/2-3-nested_attributes.patch | |
module ActiveRecord | |
module NestedAttributes #:nodoc: | |
def assign_nested_attributes_for_one_to_one_association(association_name, attributes) |
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
require "rubygems" | |
require "pivotal_tracker" | |
require "rest_client" | |
pt = PivotalTracker::Client.token = "" | |
fetched_occurred_at = nil | |
def speach(text) | |
resp = RestClient.get "http://translate.google.com/translate_tts?tl=en&q=#{URI.escape(text)}" |
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
require "rubygems" | |
require "oauth" | |
require "json" | |
require "action_pack" | |
require "active_support" | |
consumer_key = "AsuesLsQlNSqTmlr3off" | |
consumer_secret = "n7xvBRGBfdtIm2jQ5T2U65T7XO2hmX3FJt5f7cJw" | |
consumer = OAuth::Consumer.new(consumer_key, |
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
require "rubygems" | |
require "sinatra" | |
require "oauth" | |
require 'hpricot' | |
require "cgi" | |
set :logging, true | |
post "/" do | |
consumer_token = ENV["CTOKEN"] |
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
require "rubygems" | |
require "oauth" | |
consumer_key = "consumer_key" | |
consumer_secret = "consumer_secret" | |
consumer = OAuth::Consumer.new(consumer_key, | |
consumer_secret, | |
:site => "https://www.youroom.in/") |
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
Processing Group::EntriesController#create to json (for 118.67.95.146 at 2010-07-12 15:46:12) [POST] | |
Parameters: {"format"=>"json", "action"=>"create", "group_id"=>"861", "controller"=>"group/entries", "entry"=>{"content"=>"テスト", "parent_id"=>"54363"}, "subdomains"=>["www"]} | |
[DEBUG] base_string: POST&https%3A%2F%2Fwww.youroom.in%2Fr%2F861%2Fentries.json&entry%255Bcontent%255D%3D%25E3%2583%2586%25E3%2582%25B9%25E3%2583%2588%26entry%255Bparent_id%255D%3D54363%26oauth_consumer_key%3DwxN9D8pxK6Mne7hXNOxm%26oauth_nonce%3D2071335585280635%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1278917171%26oauth_token%3DcDYl4BT9msMxvdQXdK2w%26oauth_version%3D1.0 | |
[DEBUG] signature: b/ckbNyHXhTtcsM+JV1hRC5LpMk= | |
[DEBUG] request signature: 8YN1rU/+M2NDqKbeaCWRC8mCrtQ= | |
[DEBUG] verify: false |
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
----- GET ------------------------------ | |
[DEBUG] base_string: GET&http%3A%2F%2Fwww.youroom.sg%2Fr%2F5%2Fentries%2F502.json&oauth_consumer_key%3DTIgbVRWSQxtjenI2GGAA%26oauth_nonce%3D1623924774661838%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1278469756%26oauth_token%3DkVMqX5MubwyetjYQSfwD%26oauth_version%3D1.0 | |
[DEBUG] signature: HPS83IIVNIvPxMqkboMlL1RKwFk= | |
[DEBUG] request signature: HPS83IIVNIvPxMqkboMlL1RKwFk= | |
[DEBUG] verify: true | |
----- POST ------------------------------ | |
[DEBUG] base_string: POST&http%3A%2F%2Fwww.youroom.sg%2Fr%2F5%2Fentries.json&oauth_consumer_key%3DTIgbVRWSQxtjenI2GGAA%26oauth_nonce%3D1623956568200271%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1278469788%26oauth_token%3DkVMqX5MubwyetjYQSfwD%26oauth_version%3D1.0 | |
[DEBUG] signature: oQXl/VvGSWmA7ZBUOFdT10rZHHI= | |
[DEBUG] request signature: USnE67Ypx0VkIrqKJzJIuXq0TLw= |
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
<?xml version="1.0" encoding="UTF-8" ?> | |
<Module> | |
<ModulePrefs title="youRoom Home" scrolling="true"> | |
<Require feature="opensocial-0.8" /> | |
<Require feature="locked-domain"/> | |
<OAuth> | |
<Service name="youroom"> | |
<Access url="http://youroom.sg/oauth/access_token" method="GET" /> | |
<Request url="http://youroom.sg/oauth/request_token" method="GET" /> |
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
require "rubygems" | |
require "oauth" | |
consumer_key = "consumer_key" | |
consumer_secret = "consumer_secret" | |
consumer = OAuth::Consumer.new(consumer_key, | |
consumer_secret, | |
:site => "https://www.youroom.in") |