This file contains 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
source :forward | |
source(:http) { | |
port '8889' | |
} | |
foo_path = '/tmp/foo.log' | |
match(:file, 'heartbeat.**') { | |
path foo_path |
This file contains 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 'timecop' | |
module ActiveRecordDetectTimeInScopes | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def scope(*args) | |
scope_caller = caller | |
Timecop.travel(Time.now) do | |
Timecop.top_stack_item.define_singleton_method :time do |
This file contains 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
li.entry:not(.haiku2_default_text) { | |
display:none; | |
} | |
li.entry.one_comment { | |
display:block; | |
} | |
body { | |
min-height: 2000px; |
This file contains 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
$ time ruby -S bundle _1.0.22_ exec ruby -e '' | |
ruby -S bundle _1.0.22_ exec ruby -e '' 1.50s user 0.25s system 95% cpu 1.829 total | |
$ time ruby -S bundle _1.1.0_ exec ruby -e '' | |
ruby -S bundle _1.1.0_ exec ruby -e '' 1.09s user 0.21s system 94% cpu 1.388 total |
This file contains 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 'digest/sha1' | |
require 'pathname' | |
require 'open-uri' | |
require 'uri' | |
require 'nokogiri' | |
module PhotozouScraper | |
PHOTOZOU_URL = 'http://photozou.jp' |
This file contains 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
def pbcopy(str) | |
IO.popen('pbcopy', 'r+') {|io| io.puts str } | |
output.puts "-- Copy to clipboard --\n#{str}" | |
end | |
Pry.config.commands.command "hiscopy", "History copy to clipboard" do |n| | |
pbcopy _pry_.input_array[n ? n.to_i : -1] | |
end | |
Pry.config.commands.command "copy", "Copy to clipboard" do |str| |
This file contains 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
autocmd VimLeave * silent! exe '!echo -n "^[kvim leave^[\\"' |
This file contains 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
From 8f33021b62c3716d153d8f1dbb7b403a300e8164 Mon Sep 17 00:00:00 2001 | |
From: Yuichi Tateno <hotchpotch@gmail.com> | |
Date: Mon, 3 Oct 2011 16:51:19 +0900 | |
Subject: [PATCH] OobGC: force GC.start | |
--- | |
lib/unicorn/oob_gc.rb | 2 ++ | |
1 files changed, 2 insertions(+), 0 deletions(-) | |
diff --git a/lib/unicorn/oob_gc.rb b/lib/unicorn/oob_gc.rb |
This file contains 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
# # your config.ru | |
# require 'unicorn_killer' | |
# use UnicornKiller::MaxRequests, 1000 | |
# use UnicornKiller::Oom, 400 * 1024 | |
module UnicornKiller | |
module Kill | |
def quit | |
sec = (Time.now - @process_start).to_i | |
warn "#{self.class} send SIGQUIT (pid: #{Process.pid})\talive: #{sec} sec" |
This file contains 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
{ | |
"name": "Chrome Keyconfig", | |
"version": "1.11.0", | |
"normal_actions": { | |
"j": { | |
"name": "scroll down", | |
"args": [] | |
}, | |
"k": { | |
"name": "scroll up", |