Skip to content

Instantly share code, notes, and snippets.

@migrs
migrs / .screenrc
Created April 6, 2011 09:09
minimum dotfiles
escape ^Tt
defbce on
vbell off
termcapinfo xterm* ti@:te@
startup_message off
defhstatus ^En:^Et
maptimeout 0
autodetach on
altscreen on
defscrollback 10000
source ~/.vim/config/vundle.vim
" vim
source ~/.vim/config/basic.vim
source ~/.vim/config/keymap.vim
source ~/.vim/config/omnifunc.vim
" bundles
source ~/.vim/config/skk.vim
source ~/.vim/config/rails.vim
source ~/.vim/config/unite.vim
source ~/.vim/config/neocomplcache.vim
@migrs
migrs / gist:1501434
Created December 20, 2011 12:38
7lang7week p207
(def col-types {clojure.lang.PersistentHashSet :map clojure.lang.PersistentList :list clojure.lang.PersistentVector :vector})
(defn collection-type [col] (col-types (class col)))
@migrs
migrs / gist:1615032
Created January 15, 2012 08:14
Powder / Powify Comparison
Powder | Powify
[Server Commands]
Install pow server ( curl get.pow.cx | sh )
powder install | powify server install
Reinstall pow server
- | powify server reinstall
@migrs
migrs / bluepill.rb
Created January 30, 2012 08:49
process checks for nscd
Bluepill.application("system", :log_file => '/var/log/bluepill/system.log') do |app|
app.process('nscd') do |process|
process.pid_file = '/var/run/nscd/nscd.pid'
process.start_command = '/etc/init.d/nscd start'
process.stop_command = '/etc/init.d/nscd stop'
process.restart_command = '/etc/init.d/nscd restart'
process.checks :mem_usage, :every => 10.minutes, :below => 100.megabytes, :times => [3,5]
end
end
@migrs
migrs / bluepill
Created February 16, 2012 06:27
bluepill init script
#!/bin/sh
### BEGIN INIT INFO
# Provides: bluepill
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: bluepill daemon, providing process monitoring
# Description: bluepill is a monitoring tool. More info at http://github.com/arya/bluepill.
@migrs
migrs / gist:2485264
Created April 25, 2012 01:30
Ruby Indent Style
class Hoge
def foo
puts 'foo';end
def baz
if true
puts 'baz'
else
raise 'baz';end;end;end
@migrs
migrs / config.ru
Created September 26, 2012 13:53
rack-server-page layout sample
require 'rack-server-pages'
require 'tilt'
run Rack::ServerPages.new { |config|
config.before do
layout('public/_layout.html')
end
}
@migrs
migrs / delete-local-merged-branch
Created December 12, 2012 07:20
マージ済みローカルブランチ・リモートブランチの削除
git branch --merged | grep feature | xargs git branch -d
@migrs
migrs / git-view
Created December 13, 2012 05:06
特定のリビジョンのファイルを Vim シンタックスハイライト付きで閲覧する
#!/bin/sh
git show $1 | vim -R +"f $1" +"filetype detect" -
# Install:
# copy to $PATH and chmod +x
#
# Usage:
# git view <revision>:<path/to/file>