Skip to content

Instantly share code, notes, and snippets.

View glidenote's full-sized avatar

Akira Maeda glidenote

View GitHub Profile
compdef _hogecmd hoge
function _hogecmd {
local -a cmds
if (( CURRENT == 2 ));then
cmds=('init' 'update' 'upgrade' 'commit')
_describe -t commands "subcommand" cmds
else
_files
fi
@glidenote
glidenote / .zshrc
Created May 8, 2012 21:42
Completion script for ss
#compdef ss
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for ss
#
# Source: https://github.com/glidenote/ss-zsh-completion
#
# ------------------------------------------------------------------------------
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'webrick'
include WEBrick
server = HTTPServer.new(
:DocumentRoot => File.join(Dir.pwd, "."),
:Port => 10080
)
@glidenote
glidenote / install_vim.sh
Created May 16, 2012 14:21
install vim with homebrew
brew install \
https://raw.github.com/gist/721952/e99293dc36c9b5c27aec0a4024b848ce50b9b126/vim.rb \
--enable-interp=ruby --force
#=============================
# rbenv
#=============================
if [ -d ${HOME}/.rbenv ] ; then
PATH=${HOME}/.rbenv/bin:${PATH}
export PATH
eval "$(rbenv init -)"
fi
@glidenote
glidenote / .gitignore.diff
Created May 17, 2012 06:51
octopress .gitignore
diff --git a/.gitignore b/.gitignore
index 68a6830..7537414 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,7 +4,6 @@
.gist-cache
.pygments-cache
_deploy
-public
sass.old
@glidenote
glidenote / install-td-agent.sh
Created May 18, 2012 16:07
install td-agent
/bin/cat <<'EOF'> /etc/yum.repos.d/td.repo
[treasuredata]
name=TreasureData
baseurl=http://packages.treasure-data.com/redhat/$basearch
gpgcheck=0
EOF
yum -y update
yum -y install td-agent
/etc/init.d/td-agent start
@glidenote
glidenote / app-td-agent.conf
Created May 19, 2012 20:59
fluentd conf files
# appサーバ用の設定
<source>
type tail
path /var/log/nginx/access.log
format apache
tag nginx.access
pos_file /var/log/td-agent/nginx.pos
</source>
<match nginx.access>
@glidenote
glidenote / log-td-agent.conf
Created May 21, 2012 06:09
fluentd mail-mongodb setting
# logサーバ用の設定
<source>
type forward
port 24224
</source>
<match maillog>
type mongo
database mail
collection log
@glidenote
glidenote / post-merge
Created May 29, 2012 07:48 — forked from hirochachacha/post-merge
git-hook script for vimproc
#!/bin/sh --
set -e
echo ""
echo "START POST-MERGE HOOK"
echo ""
HOOK_DIR=`dirname $0` #git_hooks directory
PROC_DIR="$HOOK_DIR/../.." #vimproc directory