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 python | |
# -*- coding:utf-8 -*- | |
""" | |
Puyo in Python. | |
Original code: | |
http://qiita.com/arc279/items/d0a0bc2cfc710f7b1ffe | |
http://okajima.air-nifty.com/b/2011/01/2011-ffac.html | |
""" |
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
#compdef grunt | |
### 変数や関数を使用する場合の注意 | |
# - 変数を使用する場合は、定義が グローバル に漏れないよう、必ず local or typeset(declare) コマンド使って変数宣言を行うこと | |
# - 関数はグローバルに定義されるため、重複しないよう名前付けには十分配慮すること | |
# − 短い補完関数であれば、関数を使わずに書くと良い | |
function __grunt() { | |
### 必要な変数を定義 | |
# 現在のコンテキスト(curcontext) を保存 |
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
#compdef httpstatus | |
# | |
# httpstatus コマンド用zsh補完関数 | |
# | |
# このファイルfpathの通ったディレクトリに置きzshを再起動して下さい。 | |
# その際ファイル名を必ず _httpstatus として下さい。 | |
# | |
# $ cp _httpstatus /usr/local/share/zsh/site-functions | |
# $ exec zsh | |
# |
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
# | |
# zaw-src-git-log | |
# | |
# zaw source for git log. | |
# https://gist.github.com/4350604 | |
# | |
# zaw : https://github.com/nakamuray/zaw | |
# | |
# git log pretty format: For detail, refer to "man git-log" |
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
# | |
# zaw | |
# | |
# https://github.com/zsh-users/zaw | |
# https://github.com/nakamuray/zaw | |
# | |
# zsh anything.el-like widget | |
# | |
# Execute action by pressing enter key or | |
# press Meta-enter for alternative action. |
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
### Directory aliases | |
# e.x. | |
# $ hash -d hoge=/to/path | |
# $ ls ~hoge | |
set_hash_in_links() { | |
local links=~/links | |
[ ! -d "$links" ] && return 0 | |
[ $(command ls -1 "$links" | wc -l) -eq 0 ] && return 0 | |
local src | |
local target |
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
# Add the following function to ~/.bashrc or ~/.zshrc | |
function cdsite() { | |
local py_cmd | |
py_cmd=`cat << 'EOF' | |
from __future__ import print_function | |
import sys | |
import os | |
import site |
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
#!/bin/sh | |
# | |
# Edit command source | |
# | |
if [ $# -lt 1 ]; then | |
echo 'Should specify commands you want to edit' 1>&2 | |
exit 1 | |
fi |
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
#!/bin/sh | |
# | |
# 引数なし | |
# - homebrewの情報を色々表示 | |
# | |
# 第1引数: | |
# - Formula名指定でFormulaの詳細情報を表示 | |
# - マッチするFormulaがない場合は検索 | |
# | |
if ! type brew >/dev/null 2>&1; then |
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
#!/bin/bash | |
# | |
# Print detail infomation about current git repository. | |
# | |
if ! type git > /dev/null 2>&1; then | |
echo 'Error: Git is not installed' 2>&1 | |
exit 1 | |
fi |
NewerOlder