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 'thread' | |
module Safe | |
def safe( level = 4 ) | |
result = nil | |
if $SAFE < level then | |
Thread.start { | |
$SAFE = level | |
result = yield | |
}.join | |
else |
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/tdiary.rb b/tdiary.rb | |
index e1808c7..3f04184 100644 | |
--- a/tdiary.rb | |
+++ b/tdiary.rb | |
@@ -106,15 +106,14 @@ end | |
=begin | |
== Safe module | |
=end | |
-require 'thread' | |
module Safe |
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 ) |
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
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
# = 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
#!/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
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
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' |