Skip to content

Instantly share code, notes, and snippets.

@kunitoo
kunitoo / KokonTouzai.java
Created October 28, 2011 01:43
古今東西java.langの判定プログラムを愚直に作ってみた
package game;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class KokonTouzai {
public static void main(String[] args) throws IOException{
KokonTouzai kokonTouzai = KokonTouzai.newInstance();
@kunitoo
kunitoo / create_branch.sh
Created November 4, 2011 08:28
local,remoteにブランチを作成して移動する
#/bin/sh
if [ $# -ne 1 ]; then
echo "sh create_branch.sh 'branch_name'" 1>&2
exit 1
fi
git branch $1
git checkout $1
git push origin $1
$('a.left').html(
$('<img>')
.attr('src', 'http://docs.komagata.org/theme/p0t/images/movable_face.gif')
.attr('class', 'mega-icon-invertocat')
);
@kunitoo
kunitoo / gist:0170099d3eacb3364a28
Last active December 26, 2015 08:07
第2回 ESMオフラインどう書く 例題 https://gist.github.com/mattsan/38a752dca30423902b0a
require 'rubygems'
require 'neography'
@neo = Neography::Rest.new
def clean_nodes
@neo.execute_query('match n detach delete n')
end
def setup_nodes
@kunitoo
kunitoo / error.txt
Last active December 15, 2015 04:12
rabbit error
/home/kunitoo/.rbenv/versions/2.3.0-preview2/lib/ruby/gems/2.3.0/gems/rabbit-2.1.8/lib/rabbit/parser/ext/entity.rb:355: warning: key "Dagger" is duplicated and overwritten on line 2409
/home/kunitoo/.rbenv/versions/2.3.0-preview2/lib/ruby/gems/2.3.0/gems/rabbit-2.1.8/lib/rabbit/parser/ext/entity.rb:357: warning: key "dagger" is duplicated and overwritten on line 2411
/home/kunitoo/.rbenv/versions/2.3.0-preview2/lib/ruby/gems/2.3.0/gems/rabbit-2.1.8/lib/rabbit/theme/default-item-mark-setup/default-item-mark-setup.rb:56: [BUG] Segmentation fault at 0x00000000000049
ruby 2.3.0preview2 (2015-12-11 trunk 53028) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0065 p:0019 s:0414 e:000412 BLOCK /home/kunitoo/.rbenv/versions/2.3.0-preview2/lib/ruby/gems/2.3.0/gems/rabbit-2.1.8/lib/rabbit/theme/default-item-mark-setup/def
c:0064 p:0224 s:0404 e:000403 BLOCK /home/kunitoo/.rbenv/versions/2.3.0-preview2/lib/ruby/gems/2.3.0/gems/rabbit-2.1.8/lib/rabbit/theme/applier.rb:94
c
@kunitoo
kunitoo / star.rb
Last active December 26, 2015 08:08
瞬き星 〜 第2回 ESM オフラインどう書く (2015/12/24) https://gist.github.com/mattsan/07674b095908fda117a0
require 'rubygems'
class Node
attr :name
attr_accessor :color
def initialize(name, color)
@name = name
@color = color
end
@kunitoo
kunitoo / Gemfile
Last active January 15, 2016 04:22
瞬き星 〜 第2回 ESM オフラインどう書く ( Ruby + Neo4j ) https://gist.github.com/mattsan/07674b095908fda117a0
source 'https://rubygems.org'
gem 'neo4j'
@kunitoo
kunitoo / bouwkamp.rb
Created February 14, 2016 13:15
まわせ! Bouwkamp!! 横へな2016.2.6 問題
class Rectangle
attr_accessor :x, :y, :size
def initialize(x, y, size)
@x = x
@y = y
@size = size
end
def include?(x, y)
@x <= x && @x + @size > x && @y <= y && @y + @size > y
@kunitoo
kunitoo / README.md
Last active May 6, 2016 09:33
ESM オフラインリアルタイムどう書く 拡大版

ESM じゃんけん大会 - 拡大版 ESM オフラインリアルタイムどう書く (2016/03/24,25)

オフラインリアルタイムどう書く という、 @Nabetani さん主催のイベントを模したものを ESM の社内向けに行ったものです。

出題者: @kunitoo スペシャルサンクス: @mattsan, @mtsmfm

問題

@kunitoo
kunitoo / q1.rb
Last active April 16, 2016 05:06
Toyama.rb #05 問題1
module Q1
def self.count
coins = [10, 50, 100, 500]
result = []
(2..15).each do |n|
coins.repeated_combination(n).each do |cs|
result << cs if cs.inject(:+) == 1000
end
end