LineLengthSniff.php:
// changed for Japanese text.
// public $lineLimit = 80;
public $lineLimit = 500;
FunctionCommentSniff.php:
// comment out for Japanese comment.
// if (preg_match('|[A-Z]|', $testShort[0]) === 0) {
| # Show Git branch name and number of changed files | |
| # if current directory is in Git repo. | |
| # カレントディレクトリが Git リポジトリの場合に | |
| # 現在のブランチと変更ファイルの数を表示する形にコマンドプロンプトをカスタマイズする | |
| if [ $TERM == xterm ]; then | |
| PS1='\[$(tput setaf 4)\]\u:\W\$\[$(tput sgr0)\]$(if git status &>/dev/null;then echo \[$(tput setaf 5)\][$(git branch | grep ^\* | cut -d " " -f 2) changed:$(git status -s | wc -l)]\[$(tput sgr0)\];fi) ' | |
| fi |
LineLengthSniff.php:
// changed for Japanese text.
// public $lineLimit = 80;
public $lineLimit = 500;
FunctionCommentSniff.php:
// comment out for Japanese comment.
// if (preg_match('|[A-Z]|', $testShort[0]) === 0) {
| <?php | |
| // ユーザの表示ページ、かつ、そのユーザが admin 以外なら表示する | |
| $matches = array(); | |
| $result = preg_match('/^user(\/(\d+))?$/', request_path(), $matches); | |
| if ($result && (count($matches) == 1 || $matches[2] != 1)) { | |
| return TRUE; | |
| } | |
| else { |
| <?php | |
| /** | |
| * ユーザが特定のロールを持つかどうかを調べる | |
| * | |
| * @param object $account | |
| * チェック対象ユーザのオブジェクト。 | |
| * @param array|int $roles | |
| * ロールの文字列の配列。インデックス配列。 |
| #!python3 | |
| # coding: utf-8 | |
| """ | |
| usage: python convert_timestamp_to_date.py [timestamp] | |
| If you add alias for this, it's much easier to use this. | |
| """ | |
| # サイト全体のはてブ数を取得する | |
| # get the sum total of hatena bookmark count for a site | |
| # | |
| # usage: | |
| # hatena_get_count_for_site http://example.com | |
| # | |
| function hatena_get_count_for_site { | |
| # @see http://developer.hatena.ne.jp/ja/documents/bookmark/apis/getcount | |
| if [ "$#" -ne 1 ]; then |
| # coding: utf-8 | |
| # 1 日の 30 分刻みの時刻をすべて生成する | |
| # 00:00, 00:30, 01:30, ..., 23:30 | |
| hours = [] | |
| for h in range(24): | |
| for m in (0, 30): | |
| hours.append('{0:02d}:{1:02d}'.format(h, m)) |