This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" standalone="no"?> | |
<a:fontScheme name="mirakui" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"> | |
<a:majorFont> | |
<a:latin typeface="Stone Sans ITC TT"/> | |
<a:ea typeface=""/> | |
<a:cs typeface=""/> | |
<a:font script="Jpan" typeface="小塚ゴシック Pr6N H"/> | |
<a:font script="Hang" typeface="맑은 고딕"/> | |
<a:font script="Hans" typeface="宋体"/> | |
<a:font script="Hant" typeface="新細明體"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved | |
filetype off " required! | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
" let Vundle manage Vundle | |
" required! | |
Bundle 'gmarik/vundle' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "rest-client" | |
OFFSET = 700 | |
STEP = 100 | |
def exist?(url) | |
res = RestClient.head url | |
res.code == 200 | |
rescue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[STDOUT, STDERR].each do |io| | |
io.instance_eval do | |
def puts_with_format(*arg) | |
print "[#{Time.now.strftime("%Y-%m-%d %H:%M:%S")} ##{$$}] " | |
puts_without_format *arg | |
end | |
alias puts_without_format puts | |
alias puts puts_with_format | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
APP_PATH = File.expand_path('../../config/application', __FILE__) | |
require File.expand_path('../../config/boot', __FILE__) | |
require 'rails/commands/console' | |
require APP_PATH | |
Rails.application.require_environment! | |
require "arproxy" | |
module Arproxy | |
class Readonly < Base |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat script.txt | |
grep hoge /var/log/nginx/access.log | |
$ rop.rb -H 'app-0{01..05}' -f script.txt | |
/tmp/rop/0522-2306-11/app-001 | |
/tmp/rop/0522-2306-11/app-002 | |
/tmp/rop/0522-2306-11/app-003 | |
/tmp/rop/0522-2306-11/app-004 | |
/tmp/rop/0522-2306-11/app-005 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% rails -v | |
Rails 3.2.5 | |
% rails benchmarker -h | |
Usage: rails benchmarker 'Ruby.code' 'Ruby.more_code' ... [OPTS] | |
-r, --runs N Number of runs. | |
Default: 4 | |
-o, --output PATH Directory to use when writing the results. | |
Default: tmp/performance | |
-m, --metrics a,b,c Metrics to use. | |
Default: wall_time,memory,objects,gc_runs,gc_time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
class Hoge | |
attr_accessor :hoge? | |
end | |
hoge = Hoge.new | |
hoge.hoge? = true | |
p hoge.hoge? # => true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FooController < ApplicationController | |
caches_action :index | |
def index | |
render :text => Time.now | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "optparse" | |
def usage | |
STDERR.puts "usage: #{$0} /path/to/unicorn.pid [-t timeout_sec]" | |
end | |
timeout = 60 | |
pidfile = ARGV.shift |