Skip to content

Instantly share code, notes, and snippets.

sowawa sowawa

Block or report user

Report or block sowawa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sowawa
sowawa / gist:5610150
Last active Dec 17, 2015
luhn check sum(ISO 7812)
View gist:5610150
"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
View README.md
git clone git://gist.github.com/{gist_id}.git
@sowawa
sowawa / sinachiku.rb
Created Jun 18, 2012 — forked from mattn/sinachiku.rb
sinatra on mruby
View sinachiku.rb
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|
@sowawa
sowawa / consistent_hashr.rb
Created May 7, 2012 — forked from prisoner/consistent_hashr.rb
A Consistent Hashing implementation for Ruby
View consistent_hashr.rb
require 'zlib'
module ConsistentHashr
@circle = {}
@number_of_replicas = 20
##
# Computes a key
def self.hash_key(key)
Zlib.crc32("#{key}")
View README.md
@sowawa
sowawa / #{fileName}
Created Apr 28, 2012
This is a test description
@sowawa
sowawa / #{fileName}
Created Apr 28, 2012
This is a test description
@sowawa
sowawa / .gitignore
Created Apr 28, 2012
Rails 4.0 beta new repository named hoge
View .gitignore
# 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.
@sowawa
sowawa / .recipe
Created Apr 28, 2012
Installing rails 4.0.0 beta
View .recipe
thumbnail: http://pds.exblog.jp/pds/1/201101/16/02/d0055302_13383029.jpg
video: http://www.youtube.com/watch?v=UE27t_LJpx0
You can’t perform that action at this time.