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.10.0' | |
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
[ERROR] #<Class:0x7fc3f0c50ec0>: execution expired | |
[ERROR] #<Class:0x7fc3f0cb9c40>: execution expired | |
[ERROR] #<Class:0x7fc3f0cb2a30>: execution expired | |
/usr/lib/ruby/1.8/timeout.rb:60: [BUG] Segmentation fault | |
ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux] | |
zsh: abort termtter |
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 'delegate' | |
class EnumValue < SimpleDelegator | |
def initialize(name, value) | |
@name = name | |
@value = value | |
super(@value) | |
end | |
def to_s |
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/protobuf/message/message.rb b/lib/protobuf/message/message.rb | |
index 3083618..856a128 100644 | |
--- a/lib/protobuf/message/message.rb | |
+++ b/lib/protobuf/message/message.rb | |
@@ -120,7 +120,7 @@ module Protobuf | |
def initialize(values={}) | |
@values = {} | |
- self.class.fields.each do |tag, field| | |
+ self.class.fields.to_a.each do |tag, field| |
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
# OAuth desktop client example | |
require 'oauth' | |
CONSUMER_KEY = 'xxxx' | |
CONSUMER_SECRET = 'xxxx' | |
access_token = nil | |
access_secret = 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
Traceback (most recent call last): | |
File "phonenumber_util.py", line 4, in <module> | |
data.ParseFromString(open('data/PhoneNumberMetadataProto_US').read()) | |
File "/usr/lib/pymodules/python2.6/google/protobuf/message.py", line 168, in ParseFromString | |
self.MergeFromString(serialized) | |
File "/usr/lib/pymodules/python2.6/google/protobuf/reflection.py", line 824, in MergeFromString | |
raise message_mod.DecodeError('Unexpected end-group tag.') | |
google.protobuf.message.DecodeError: Unexpected end-group tag. |
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
#!/bin/sh -e | |
zipfile="$1" | |
dir="$2" | |
if test -z "$2"; then | |
echo "USAGE: $0 ZIPFILE DIR" | |
exit | |
fi |
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
macks@debian:~/test$ ls | |
test.rb test1.proto test2.proto | |
macks@debian:~/test$ cat test1.proto | |
package A; | |
message m1 | |
{ | |
required uint32 aaa = 1 [ default = 0 ]; | |
optional uint32 bbb = 2 [ default = 0 ]; | |
} | |
macks@debian:~/test$ cat test2.proto |
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 'date' | |
require 'rubygems' | |
require 'bundler' | |
Bundler.setup | |
require 'icalendar' | |
cal = Icalendar::Calendar.new | |
cal.timezone do | |
tzid 'Tokyo/Asia' | |
standard 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
Sequel.connect( | |
"mysql://user:password@host/database", | |
:compress => false # Required! | |
) |