Skip to content

Instantly share code, notes, and snippets.

View hotchpotch's full-sized avatar

Yuichi Tateno (secon) hotchpotch

View GitHub Profile
@hotchpotch
hotchpotch / gist:1446423
Created December 8, 2011 08:01
Vim 抜けるときに screen のウィンドウ名を変える
autocmd VimLeave * silent! exe '!echo -n "^[kvim leave^[\\"'
From 8f33021b62c3716d153d8f1dbb7b403a300e8164 Mon Sep 17 00:00:00 2001
From: Yuichi Tateno <[email protected]>
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 October 3, 2011 08:11
Unicorn process killer utility
# # 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 July 29, 2011 09:57
ChromeKeyConfig My Settings
{
"name": "Chrome Keyconfig",
"version": "1.11.0",
"normal_actions": {
"j": {
"name": "scroll down",
"args": []
},
"k": {
"name": "scroll up",
@hotchpotch
hotchpotch / cocproxy.nginx.conf
Created May 25, 2011 04:50
cocproxy for nginx
#!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 13:29
rounzi night playlist
#!ruby
require 'rubygems'
require 'rbosa'
target_playlist = 'rounzi night'
OSA.utf8_strings = true
OSA::ObjectSpecifierList.extend Enumerable
itunes = OSA.app('iTunes')
@hotchpotch
hotchpotch / sass_convert.diff
Created May 9, 2011 07:56
force change style nested -> expanded sass-convert command.
diff --git a/lib/sass/tree/visitors/convert.rb b/lib/sass/tree/visitors/convert.rb
index 5eac1aa..833e563 100644
--- a/lib/sass/tree/visitors/convert.rb
+++ b/lib/sass/tree/visitors/convert.rb
@@ -21,7 +21,7 @@ class Sass::Tree::Visitors::Convert < Sass::Tree::Visitors::Base
def visit_children(parent)
@tabs += 1
return @format == :sass ? "\n" : " {}\n" if parent.children.empty?
- (@format == :sass ? "\n" : " {\n") + super.join.rstrip + (@format == :sass ? "\n" : " }\n")
+ (@format == :sass ? "\n" : " {\n") + super.join.rstrip + (@format == :sass ? "\n" : " \n#{' '*(@tabs-1)}}\n")
@hotchpotch
hotchpotch / git-ssh-create
Created February 7, 2011 13:34
git repos create over ssh
#!/usr/bin/env ruby
confbase = 'git-ssh-create'
init_command = 'git init --bare --shared=true'
server = `git config --global #{confbase}.server`.chomp
if server.empty?
warn "Please set git config server."
warn " git config --global #{confbase}.server '[username@]yourserver.example.com'"
exit 1
args = '--no-ri --no-rdoc'
re = %r{(.+?)\s+\((.+)\)}
`gem list`.split("\n").each do |gem|
_, package, versions = gem.match(re).to_a
if package
versions.split(/,\s*/).each do |version|
puts "gem install #{args} -v='#{version}' #{package}"
end
end
diff -r b73ac21f2453 AutoPatchWork/AutoPatchWork.js
--- a/AutoPatchWork/AutoPatchWork.js Sun Oct 24 02:01:42 2010 +0900
+++ b/AutoPatchWork/AutoPatchWork.js Sat Dec 25 09:53:34 2010 +0900
@@ -47,6 +47,7 @@
options.BASE_REMAIN_HEIGHT = info.config.remain_height;
options.DEFAULT_STATE = info.config.auto_start;
options.FORCE_TARGET_WINDOW = info.config.target_blank;
+ options.REPLACE_STATE = info.config.replace_state;
options.css = info.css;
debug = info.config.debug_mode;