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/env ruby | |
require 'rubygems' | |
require 'erubis' | |
require 'erubis/tiny' | |
require 'erb' | |
@date = Time.now | |
str = "<%%= Time::at( <%= @date.to_i %> ) %>" | |
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 'twitter' | |
helpers do | |
include Rack::Utils | |
alias_method :h, :escape_html | |
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
require 'rubygems' | |
require 'twitter' | |
def get_friends(twit, page = 1) | |
r = twit.friends(:page => page) | |
(r.size == 100) ? r.concat(get_friends(twit, page + 1)) : r | |
end | |
UID = 'your_twitter_id' | |
PASSWORD = 'your_twitter_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
require 'rubygems' | |
require 'sinatra' | |
require 'oauth' | |
require 'twitter' | |
helpers do | |
include Rack::Utils | |
alias_method :h, :escape_html | |
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
require 'rubygems' | |
require 'sinatra' | |
require 'appengine-apis/datastore' | |
# Make sure our template can use <%=h | |
helpers do | |
include Rack::Utils | |
alias_method :h, :escape_html | |
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/env ruby | |
require 'pstore' | |
require 'pp' | |
file = ARGV[0] | |
db = PStore.new(file) | |
db.transaction(true) do | |
pp db | |
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
# = AppEngine::PStore -- | |
# | |
# A PStore compatible interface using the Datastore. | |
# This module is based on pstore.rb written by matz. | |
# | |
require 'pstore' | |
require 'digest/md5' | |
require 'rubygems' | |
require 'appengine-apis/datastore' |
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 'benchmark' | |
require 'memcache' | |
require 'pstore' | |
def benchmark(cache) | |
count = 10000 | |
key_size = 1000 | |
Benchmark.bm do |bm| | |
bm.report("#{cache.class.to_s}#put") do |
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
Index: index.fcgi | |
=================================================================== | |
--- index.fcgi (revision 3594) | |
+++ index.fcgi (working copy) | |
@@ -1,4 +1,4 @@ | |
-#!/usr/bin/env ruby | |
+#!/usr/local/bin/ruby | |
# -*- coding: utf-8; -*- | |
# | |
# index.fcgi $Revision: 1.35 $ |
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
diff --git a/core/tdiary/dispatcher.rb b/core/tdiary/dispatcher.rb | |
index be54430..974a982 100644 | |
--- a/core/tdiary/dispatcher.rb | |
+++ b/core/tdiary/dispatcher.rb | |
@@ -204,11 +204,11 @@ module TDiary | |
@target = TARGET[target] | |
end | |
- def dispatch_cgi( cgi = CGI.new, stdout = STDOUT, stderr = STDERR ) | |
+ def dispatch_cgi( cgi = CGI.new, stdout = nil, stderr = nil ) |
OlderNewer