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
# coding: utf-8 | |
# Ruby: 1.9.1p243 (2009-07-16 revision 24175) [i486-linux] | |
# dm-core: 'next' branch | |
# data_objects: 'next' branch | |
require 'dm-core' | |
class Foo | |
include DataMapper::Resource |
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
# Fix for Rack CGI handler's POST parameters | |
require 'rack/rewindable_input' | |
app = proc {|env| | |
env['rack.input'] = input = Rack::RewindableInput.new(env['rack.input']) | |
begin | |
YourApplication.call(env) | |
ensure | |
input.close | |
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
# -*- coding: utf-8 -*- | |
module Termtter::Client | |
register_command( | |
:name => :friends, | |
:aliases => [:followings], | |
:help => ['friends,followings', 'Show followings'], | |
:exec_proc => lambda {|arg| | |
user_name = arg.strip.sub(/^@/, '') |
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/lib/termtter/api.rb b/lib/termtter/api.rb | |
index eca96ea..c30ed83 100644 | |
--- a/lib/termtter/api.rb | |
+++ b/lib/termtter/api.rb | |
@@ -22,7 +22,7 @@ module Termtter | |
consumer = OAuth::Consumer.new(CONSUMER_KEY, CONSUMER_SECRET, :site => 'http://twitter.com') | |
access_token = OAuth::AccessToken.new(consumer, config.access_token, config.access_token_secret) | |
@twitter = OAuthRubytter.new(access_token, twitter_option) | |
- config.user_name = @twitter.verify_credentials[:name] | |
+ config.user_name = @twitter.verify_credentials[:screen_name] |
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
# -*- coding: utf-8 -*- | |
class Rubytter | |
alias update__without_strict140 update | |
def update(status, params = {}) | |
if (characters = status.split(//u)).size > 140 | |
status = characters[0, 140].join | |
end | |
update__without_strict140(status, params) |
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
# Bigint support for DataMapper/MySQL | |
# | |
# e.g.) | |
# property :value, Bigint | |
gem 'dm-core', '0.9.11' | |
require 'dm-core' | |
require 'dm-core/adapters/mysql_adapter' |
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
# Column-level collation support for DataMapper/MySQL | |
# | |
# e.g.) | |
# property :name, String, :collate => 'utf8_bin' | |
gem 'dm-core', '0.9.11' | |
require 'dm-core' | |
require 'dm-core/adapters/mysql_adapter' |
NewerOlder