Skip to content

Instantly share code, notes, and snippets.

@tmtm
tmtm / mysql_unicode_collation.rb
Created April 16, 2011 06:25
MySQL 5.5.11 unicode_ci で同一視される文字
#!/usr/local/bin/ruby
# -*- coding: utf-8 -*-
require 'cgi'
filename, = ARGV # path of file `ctype-uca.c'
ctype_uca = File.read(filename)
ctype_uca =~ /^uchar uca_length\[256\]={\n(.*?)};$/m or raise 'uca_length not found'
uca_length = $1.gsub(/\s/,'').split(/,/).map(&:to_i)
@tmtm
tmtm / groonga_http_client.rb
Created November 26, 2010 15:52
Groonga HTTP Client for Ruby
require 'cgi'
require 'json'
require 'socket'
class GroongaHttpClient
Error = Class.new StandardError
def initialize(host, port)
@host, @port = host, port