git clone git://gist.github.com/{gist_id}.git
This file contains 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
"4242424242424242".reverse.chars.each_with_index.map{|ch, index| index.even? ? ch.to_i : (ch.to_i * 2) % 10 + (ch.to_i * 2) / 10 }.inject(:+) % 10 == 0 |
This file contains 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 'HTTP' | |
require 'UV' | |
module Sinachiku | |
@routes = { 'GET' => [], 'POST' => [] } | |
def self.route(method, path, opts, &block) | |
@routes[method] << [path, opts, block] | |
end | |
def self.do(r) | |
@routes[r.method].each {|path| |
- Tatsuhiro Ujihisa
- http://ujihisa.blogspot.com/
- 非同期とは?
- スレッド、プロセス
- プロセス生成
This file contains 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 'zlib' | |
module ConsistentHashr | |
@circle = {} | |
@number_of_replicas = 20 | |
## | |
# Computes a key | |
def self.hash_key(key) | |
Zlib.crc32("#{key}") |
httperf --server localhost --port 3000 --uri / --rate 150 --num-conn 2700 --num-call 1
This file contains 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
from api |
This file contains 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
from api |
This file contains 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
# See http://help.github.com/ignore-files/ for more about ignoring files. | |
# | |
# If you find yourself ignoring temporary files generated by your text editor | |
# or operating system, you probably want to add a global ignore instead: | |
# git config --global core.excludesfile ~/.gitignore_global | |
# Ignore bundler config | |
/.bundle | |
# Ignore the default SQLite database. |
This file contains 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
thumbnail: http://pds.exblog.jp/pds/1/201101/16/02/d0055302_13383029.jpg | |
video: http://www.youtube.com/watch?v=UE27t_LJpx0 |
NewerOlder