Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴
On vacation

Yuichi Tateno (secon) hotchpotch

🌴
On vacation
View GitHub Profile
@hotchpotch
hotchpotch / hatenaone.css
Created Mar 13, 2012
Hatena One !!!!!!!!!
View hatenaone.css
li.entry:not(.haiku2_default_text) {
display:none;
}
li.entry.one_comment {
display:block;
}
body {
min-height: 2000px;
View gist:1996817
$ 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
View photozou_scraper.rb
#!/usr/bin/env ruby
require 'digest/sha1'
require 'pathname'
require 'open-uri'
require 'uri'
require 'nokogiri'
module PhotozouScraper
PHOTOZOU_URL = 'http://photozou.jp'
@hotchpotch
hotchpotch / .pryrc
Created Mar 5, 2012
pry clipboard copy utility
View .pryrc
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|
@hotchpotch
hotchpotch / gist:1446423
Created Dec 8, 2011
Vim 抜けるときに screen のウィンドウ名を変える
View gist:1446423
autocmd VimLeave * silent! exe '!echo -n "^[kvim leave^[\\"'
View 0001-OobGC-force-GC.start.patch
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
@hotchpotch
hotchpotch / unicorn_killer.rb
Created Oct 3, 2011
Unicorn process killer utility
View unicorn_killer.rb
# # 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"
@hotchpotch
hotchpotch / gist:1113542
Created Jul 29, 2011
ChromeKeyConfig My Settings
View gist:1113542
{
"name": "Chrome Keyconfig",
"version": "1.11.0",
"normal_actions": {
"j": {
"name": "scroll down",
"args": []
},
"k": {
"name": "scroll up",
View cocproxy.nginx.conf
#!nginx -p . -c cocproxy.nginx.conf
error_log /dev/stderr debug;
daemon off;
events {
worker_connections 48;
}
http {
@hotchpotch
hotchpotch / playlist.rb
Created May 16, 2011
rounzi night playlist
View playlist.rb
#!ruby
require 'rubygems'
require 'rbosa'
target_playlist = 'rounzi night'
OSA.utf8_strings = true
OSA::ObjectSpecifierList.extend Enumerable
itunes = OSA.app('iTunes')