Skip to content

Instantly share code, notes, and snippets.

Yuki Ito mururu

Block or report user

Report or block mururu

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
@mururu
mururu / RESULTS.md
Created Nov 10, 2015
Micro benchmark of EVP for AES-CTR in Erlang/OTP
View RESULTS.md

no-EVP

1> c(bench3).
{ok,bench3}
2> bench3:run().
encrypt: 65230 times/sec
decrypt: 67715 times/sec
ok
@mururu
mururu / git-alive
Created Dec 12, 2012
Git custom command to check GitHub system status
View git-alive
#!/bin/sh
curl -s https://status.github.com/api/messages.json | \
ruby -rjson -rtime -e \
'JSON.parse(STDIN.gets).each{|s|c = {"good"=>"\e[32m", "minor"=>"\e[33m"}[s["status"]] || "\e[31m"; puts %{#{Time.parse(s["created_on"]).localtime}: #{c}#{s["body"].gsub("\n", " ")}\e[0m}}'
@mururu
mururu / exenv.rb
Created Nov 13, 2012
exenv homebrew formula
View exenv.rb
require 'formula'
class Exenv < Formula
homepage 'https://github.com/mururu/exenv'
url 'https://github.com/mururu/exenv/tarball/v0.1.0'
sha1 '8254e6351c9c5614aaa79923b152671d3585a188'
def install
prefix.install Dir['*']
@mururu
mururu / elixir-build.rb
Created Nov 13, 2012
elixir-build exenv formula
View elixir-build.rb
require 'formula'
class ElixirBuild < Formula
homepage 'https://github.com/mururu/elixir-build'
url 'https://github.com/mururu/elixir-build/tarball/v20121112'
sha1 '6d3ae172359e26ee94370ce309edad79c996ea78'
head 'https://github.com/mururu/elixir-build.git'
option "without-exenv", "Don't install as an exenv plugin"
@mururu
mururu / add_up.rb
Created May 5, 2012
配列の各要素数をカウントするやつ
View add_up.rb
class Array
def add_up
Hash.new(0).tap{|h| self.each{|v| h[v]+=1 } }
end
end
@mururu
mururu / roman.rb
Created Apr 25, 2012
Shinjuku.rb #4
View roman.rb
class Integer
def to_roman
raise if self <= 0 || self >= 4000
a = ("%04d" % self).split(//).map(&:to_i).reverse
m = { 1 => 'I', 5 => 'V', 10 => 'X', 50 => 'L', 100 => 'C', 500 => 'D', 1000 => 'M' }
(0..3).inject("") do |s,i|
i = 3 - i
s += case a[i]
View twitter-search.rb
# coding: utf-8
require "twitter"
def search(target)
result = []
(1..100).each do |i|
result << Twitter.search(target, :page => i, :rpp => 100) rescue break
end
iemon(result.flatten.uniq.sort_by(&:created_at).map(&:attrs))
@mururu
mururu / fav_to_hatebu.rb
Created Feb 13, 2012
twitter favorite -> hatena bookmark
View fav_to_hatebu.rb
# coding: utf-8
require 'rubygems'
require 'twitter'
require 'net/http'
require 'uri'
require 'digest/sha1'
# WSSE認証
def wsse(id, pass)
@mururu
mururu / soup.rb
Created Jan 25, 2012
Alphabet Soup - Facebook Hacker Cup 2012 Qualification Round
View soup.rb
# coding: utf-8
class Soup
def initialize(input)
lines = []
open(input) do |f|
lines = f.readlines.map{|l|l.chomp!}
end
@num = lines.shift.to_i
@case = lines
@mururu
mururu / billboards.rb
Created Jan 25, 2012
Billboards - Facebook Hacker Cup 2012 Qualification Round
View billboards.rb
# coding: utf-8
class Billboards
def initialize(input)
lines = []
open(input) do |f|
lines = f.readlines.map{|l|l.chomp!}
end
@num = lines.shift.to_i
@case = []
You can’t perform that action at this time.