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
View kawadu_fuck.js
window.onload = function(){
var ptr = 0;
var mem = [];
var count = 1;
var input_set = function(input) {
var splited = input.split(' ');
var ary = [];
for(var i = 0, len = splited.length; i < len; ){
ary.push(splited[i++] + splited[i++]);
}
@mururu
mururu / web-game.js
Created Oct 26, 2011
web-game .devquiz2011
View web-game.js
var card_num = 0;
var card_array = new Array();
var card_twin = new Array();
//カードの要素を取得
for (var ai = 0; true; ai++){
if(document.getElementById('card' + ai) == null){
card_num = ai;
break;
}
@mururu
mururu / hitori-game.rb
Created Oct 26, 2011
hitori-game .devquiz2011
View hitori-game.rb
=begin
入力形式
T ケースの数(1<=T<=100)
N ケース1の数の個数(1<=N<=10)
a1 a2 ... aN 与えられる数(0<=an<=1,000,000)
M ケース2の数の個数
b1 b2 ... bM 与えられる数
... ...
=end
@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 = []
@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 / 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)
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 / 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]
@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 / 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['*']
You can’t perform that action at this time.