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
// Based on code from the following sources: | |
// * http://www.voiceoftech.com/swhitley/index.php/2009/03/twitter-oauth-with-net/ | |
// * http://oauth.googlecode.com/svn/code/csharp/ | |
// Note: if you're using mono the following command will compile this code `gmcs -r:System.Web.dll this_file.cs` | |
using System; | |
using System.Security.Cryptography; | |
using System.Collections.Generic; | |
using System.Text; | |
using System.Net; |
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
require 'rubygems' | |
require 'oauth' | |
require 'xmlsimple' | |
# Create an OAuth Consumer with the appropriate API key and secret. | |
@consumer = OAuth::Consumer.new("api_key_EUNzNgVkrpFUFg", "api_secret_KBq6hTvjjvqAWOPz6c4WnQHN6jvkU8", { :site=>"https://my-domain.myhaikuclass.com" }) | |
# Create an OAuth Access Token using your personal key and secret. | |
@access_token = OAuth::AccessToken.new(@consumer, "token_959b3659b65ddbb6f8552c3401", "secret_40ec1d3617e7f58811c2f1e4416dcf2f7") |
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
require 'rubygems' | |
require 'net/http' | |
require 'net/https' | |
require 'xmlsimple' | |
# To Ping the server, we'll send a GET request. | |
@uri = URI.parse("https://my-domain.myhaikuclass.com") | |
@uri.path = "/do/services/test/ping" | |
@uri.query = "hello=world" |
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
--- a/rails-1.2.6/lib/dispatcher.rb | |
+++ b/rails-1.2.6/lib/dispatcher.rb | |
@@ -41,7 +41,7 @@ | |
controller.process(request, response).out(output) | |
end | |
rescue Exception => exception # errors from CGI dispatch | |
- failsafe_response(output, '500 Internal Server Error', exception) do | |
+ failsafe_response(output, '500 Internal Server Error', exception, response) do | |
controller ||= (ApplicationController rescue ActionController::Base) | |
controller.process_with_exception(request, response, exception).out(output) |
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
quine = <<QUINE | |
puts "quine = <<QUINE\\n" + quine.gsub('\\\\', '\\\\\\\\\\\\') + "QUINE\\n" + quine | |
QUINE | |
puts "quine = <<QUINE\n" + quine.gsub('\\', '\\\\\\') + "QUINE\n" + quine |
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
--- lib/mongrel_upload_progress/init.rb | |
+++ lib/mongrel_upload_progress/init.rb | |
@@ -32,8 +32,8 @@ | |
private | |
def upload_notify(action, params, *args) | |
- return unless @path_info.include?(params['PATH_INFO']) && | |
- params[Mongrel::Const::REQUEST_METHOD] == 'POST' && | |
+ return unless params[Mongrel::Const::REQUEST_METHOD] == 'POST' && | |
+ @path_info.detect { |r| r.is_a?(Regexp) ? r =~ params['PATH_INFO'] : r == params['PATH_INFO'] } && |
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
--- flickr-1.0.2/flickr.rb | |
+++ flickr-1.0.3/flickr.rb | |
@@ -56,7 +56,7 @@ | |
# Replace this API key with your own (see http://www.flickr.com/services/api/misc.api_keys.html) | |
def initialize(api_key=nil, email=nil, password=nil) | |
@api_key = api_key | |
- @host = 'http://flickr.com' | |
+ @host = 'http://api.flickr.com' | |
@api = '/services/rest' | |
login(email, password) if email and password |
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
require 'rubygems' | |
require 'oauth' | |
require 'xmlsimple' | |
# Create an OAuth Consumer with the appropriate API key and secret. | |
@consumer = OAuth::Consumer.new("api_key_EUNzNgVkrpFUFg", "api_secret_KBq6hTvjjvqAWOPz6c4WnQHN6jvkU8", { :site=>"https://my-domain.haikulearning.com" }) | |
# Create an OAuth Access Token using your personal key and secret. | |
@access_token = OAuth::AccessToken.new(@consumer, "token_959b3659b65ddbb6f8552c3401", "secret_40ec1d3617e7f58811c2f1e4416dcf2f7") |
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
require 'rubygems' | |
require 'oauth' | |
require 'xmlsimple' | |
# Create an OAuth Consumer with the appropriate API key and secret. | |
@consumer = OAuth::Consumer.new("api_key_EUNzNgVkrpFUFg", "api_secret_KBq6hTvjjvqAWOPz6c4WnQHN6jvkU8", { :site=>"https://my-domain.haikulearning.com" }) | |
# Create an OAuth Access Token using your personal key and secret. | |
@access_token = OAuth::AccessToken.new(@consumer, "token_959b3659b65ddbb6f8552c3401", "secret_40ec1d3617e7f58811c2f1e4416dcf2f7") |
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
require 'rubygems' | |
require 'oauth' | |
require 'xmlsimple' | |
# Create an OAuth Consumer with the appropriate API key and secret. | |
@consumer = OAuth::Consumer.new("api_key_EUNzNgVkrpFUFg", "api_secret_KBq6hTvjjvqAWOPz6c4WnQHN6jvkU8", { :site=>"https://my-domain.haikulearning.com" }) | |
# Create an OAuth Access Token using your personal key and secret. | |
@access_token = OAuth::AccessToken.new(@consumer, "token_959b3659b65ddbb6f8552c3401", "secret_40ec1d3617e7f58811c2f1e4416dcf2f7") |