Skip to content

Instantly share code, notes, and snippets.

Avatar
🍣
🍣

Tomohito Ozaki yuroyoro

🍣
🍣
View GitHub Profile
@yuroyoro
yuroyoro / exception_print_backtrace.rb
Last active Aug 29, 2015
print exception.backtrace.join("\n")と書くのに疲れた人へ
View exception_print_backtrace.rb
# -*- encoding : utf-8 -*-
class Exception
def print_backtrace(options = {:out => $stderr, :filters => []})
out = options[:out] || $stderr
filters = options[:filters]
filters = filters.nil? ? [] :
filters.respond_to?(:to_ary) ? filters.to_ary :
[filters]
View kancolle_event_201404.md

E1

- 燃料 弾薬 鋼材 ボーキ バケツ
73713 77342 89982 82623 660
71968 76608 88175 81790 642
消費 1745 734 1807 833 18

|no | ルート | 判定 | ボス泥 | 備考 |

View riak.sh
#!/bin/sh
CWD=$(cd $(dirname $0); pwd)
echo "This script will create a local riak cluster for development purposes only."
echo "Prerequisites: install riak using homebrew (tested with v1.4.8)."
echo "The cluster will be created in the current directory."
echo "Riak admin is enabled with no security.\n"
read -p "Enter a name for your cluster [cluster]: " name
View kancolle_event_201408.md
@yuroyoro
yuroyoro / chat-osx.css
Created Sep 5, 2014
HipCahtのcssをアレした( ꒪⌓꒪)
View chat-osx.css
/* /Applications/HipChat.app/Contents/Resources/chat-osx.css */
p, div {
font-family: Helvetica;
}
p, div, .nameBlock p, .messageBlock p, .messageBlock div, .messageBlock pre {
/* These are %-based to enable text size scaling options. The default text size is defined
by a function on the WebPreferences object */
font-size: 100%;
@yuroyoro
yuroyoro / resume_transaction.rb
Created Sep 18, 2014
Fiber使って、ActiveRecord::Base.transactionのblcok内でyieldして、beginとcommit/rollbackを別々の場所で実行するヤツ
View resume_transaction.rb
fiber = Fiber.new {|commit|
puts "fiber start"
ActiveRecord::Base.transaction {
puts "begin"
Fiber.yield
raise ActiveRecord::Rollback unless commit
puts "commit"
}
puts "fiber end"
}
View 2014秋event.md

2014年11月 発動!渾作戦

消費資材総計

- 燃料 弾薬 鋼材 ボーキ バケツ
E1 1942 2108 814 632 14
E2 -559 -56 -306 -886 2
E3 3439 2649 1310 1292 12
@yuroyoro
yuroyoro / client.go
Created Dec 17, 2014
GoでHTTP/2 最速実装 v3
View client.go
/*
GoHTTP/2 最速実装 v3
参考:
[HTTP/2 最速実装 v3 // Speaker Deck](https://speakerdeck.com/syucream/2-zui-su-shi-zhuang-v3)
[syucream/MinimumHTTP2](https://github.com/syucream/MinimumHTTP2)
[Hypertext Transfer Protocol version 2 (draft-ietf-httpbis-http2-14) 日本語訳](http://summerwind.jp/docs/draft-ietf-httpbis-http2-14/#section4-3)
[Jxck/http2](https://github.com/Jxck/http2)
View 2015冬event.md

2015年2月 迎撃!トラック泊地強襲

消費資材総計

- 燃料 弾薬 鋼材 ボーキ バケツ
E1 284 -423 -524 -38 1
E2 5431 4296 6608 1099 32
E3 2115 1411 1315 980 22