Skip to content

Instantly share code, notes, and snippets.

View yaotti's full-sized avatar

Hiroshige Umino yaotti

View GitHub Profile
@yaotti
yaotti / file0.sh
Created February 19, 2013 14:48
現在のブランチで加えた変更を見る ref: http://qiita.com/items/ab52a7e834422a6f9662
git log master..fix/foo
@yaotti
yaotti / some_spec.rb
Created December 13, 2012 13:34
テストにsleep入れるな問題の解決策 ref: http://qiita.com/items/dda39a9f989eda53295d
class Foo
def bar_with_timeshift
val = bar_without_timeshift
Timecop.travel(Time.now + 10.seconds)
val
end
alias_method_chain :bar, :timeshift
end
@yaotti
yaotti / file0.txt
Created November 13, 2012 04:06
Railsのログローテーション ref: http://qiita.com/items/03683b6e4a5dbc96890f
/home/httpd/Qiita/shared/log/production.log {
daily
rotate 5
size=10M
missingok
notifempty
delaycompress
postrotate
kill -USR1 $(cat ~httpd/Qiita/shared/pids/unicorn.pid)
endscript
@yaotti
yaotti / file0.txt
Created November 13, 2012 04:05
Railsのログローテーション ref: http://qiita.com/items/2c39c6ec6c023734a2ae
/home/httpd/Qiita/shared/log/production.log {
daily
rotate 5
size=10M
missingok
notifempty
delaycompress
postrotate
kill -USR1 $(cat ~httpd/Qiita/shared/pids/unicorn.pid)
endscript
@yaotti
yaotti / file0.txt
Created November 13, 2012 03:59
Railsのログローテーション ref: http://qiita.com/items/862ca6c90faa809870fd
/home/httpd/Qiita/shared/log/production.log {
daily
rotate 5
size=10M
missingok
notifempty
delaycompress
postrotate
kill -USR1 $(cat ~httpd/Qiita/shared/pids/unicorn.pid)
endscript
puts 'hello'
puts 'world!'
fooo
@yaotti
yaotti / shibuya-el-position-paper.md
Created September 5, 2012 15:07 — forked from ainame/shibuya-el-position-paper.md
shibuya.el #1 ポジションペーパー

Shibuya.el#1 ポジションペーパー

Personal

  • 名前(任意)

    • Hiroshige UMINO
  • Twitter or Facebookのアカウント or HN等

  • @yaotti, fb(yaotti)

@yaotti
yaotti / Gemfile
Created May 30, 2012 08:32
Railsでのpryコマンド利用設定&実行例 ref: http://qiita.com/items/981d546da95929317628
group :development do
gem 'pry'
gem 'pry-doc'
gem 'pry-rails'
end
@yaotti
yaotti / file0.sql
Created May 24, 2012 07:17
コマンドの実行結果をファイルに保存する ref: http://qiita.com/items/114f1dbd86b8e871e431
select foo from table_name into outfile "/tmp/output.csv" fields terminated by ',';
@yaotti
yaotti / file0.rb
Created March 14, 2012 08:17
sinatraでBasic認証 ref: http://qiita.com/items/3170
helpers do
def protected!
unless authorized?
response['WWW-Authenticate'] = %(Basic realm="Restricted Area")
throw(:halt, [401, "Not authorized\n"])
end
end
def authorized?
@auth ||= Rack::Auth::Basic::Request.new(request.env)