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
<?php | |
function to_snake_case($str) | |
{ | |
$str = preg_replace('/([a-z0-9])([A-Z])/', '$1_$2', $str); | |
return strtolower(preg_replace('/([A-Z])([A-Z])([a-z0-9])/', '$1_$2$3', $str)); | |
} | |
assert('hoge_fuga' == to_snake_case('HogeFuga')); | |
assert('qa_list' == to_snake_case('QAList')); | |
assert('aws_client' == to_snake_case('AWSClient')); |
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
function toSnakeCase($str) | |
{ | |
return strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $str)); | |
} |
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
$ cd ~/local/src/ | |
$ wget http://bash-completion.alioth.debian.org/files/bash-completion-1.2.tar.bz2 | |
$ bzip2 bash-completion-1.2.tar.bz2 | |
$ bzip2 -d bash-completion-1.2.tar.bz2 | |
$ tar xvf bash-completion-1.2.tar | |
$ rm bash-completion-1.2.tar | |
$ cd bash-completion-1.2/ | |
$ ./configure --help | |
$ ./configure --prefix=~/localll | |
$ ./configure --prefix=~/local |
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
phpenvでインストールが終わってる状態 | |
$ pyrus get | |
Pyrus version 2.0.0a4 SHA-1: 72271D92C3AA1FA96DF9606CD538868544609A52 | |
Using PEAR installation found at /Users/calpo/.phpenv/versions/5.4.4/share/pyrus/.pear | |
System paths: | |
php_dir => /Users/calpo/.phpenv/versions/5.4.4/share/pyrus/.pear/php | |
ext_dir => /Users/calpo/.phpenv/versions/5.4.4/lib/php/extensions/no-debug-non-zts-20100525 | |
cfg_dir => /Users/calpo/.phpenv/versions/5.4.4/share/pyrus/.pear/cfg | |
doc_dir => /Users/calpo/.phpenv/versions/5.4.4/share/pyrus/.pear/docs |
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
# プロンプトにマシン名(\h)とカレントのフルパス(\w)を表示 | |
#export PS1='\[\e]0;\u@\h: \w\a\]\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' | |
#export PS1='\[\e]0;\u@\h: \w\a\]\[\033[01;34m\]\u@\h\[\033[00m\]:\[\033[01;32m\]\w\[\033[00m\]\$ ' | |
#export PS1='\[\e]0;\u: \w\a\]\[\033[01;34m\]\u\[\033[00m\]:\[\033[01;32m\]\w\[\033[00m\]\$ ' | |
# grep | |
export GREP_COLOR='1;37;41' | |
alias grep='grep -E --color=auto' | |
# ls |
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
# 各ポイントで source .bashrc ではなく、ログインしなおす必要がある (PATHが追加追加でなんかうまくいかない) | |
cd | |
curl https://raw.github.com/CHH/phpenv/master/bin/phpenv-install.sh | sh | |
vi ~/.bashrc_local | |
# 追加 | |
#phpenv | |
export PATH="$HOME/.phpenv/bin:$PATH" | |
eval "$(phpenv init -)" |
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
rem http://www.apachefriends.org/jp/xampp-windows.html から | |
rem C:\xampp にXAMPPをインストールしてあるものとする | |
rem PHPUnitはもともと入ってるけどちょっと古いので | |
rem php.iniを編集 | |
rem extension=php_curl.dll | |
rem zend_extension = "C:\xampp\php\ext\php_xdebug.dll" | |
rem を有効に | |
cd C:\xampp\php |
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
<?php | |
/* | |
それぞれのロガーに対してフォーマッターがあった方が良さそう | |
フォーマッター = ロガーの特性に合わせて渡された構造体(配列)を成型する | |
= ロガーの特性に合わせてタグの処理を行なう(ファイル名にするとか) | |
ロガー+フォーマッター →注入→ ログマネージャ | |
---------------- ↓ -------------------- | |
ファクトリー | |
↓ |
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
cd ~/local/src | |
wget ftp://ftp.uni-erlangen.de/pub/utilities/screen/screen-4.0.3.tar.gz | |
tar zxvf screen-4.0.3.tar.gz | |
rm screen-4.0.3.tar.gz | |
cd screen-4.0.3/ | |
wget http://www.dekaino.net/screen/screen-4.0.2-deadlock-patch | |
wget http://www.dekaino.net/screen/screen-4.0.2-hankanacopy-patch | |
wget http://www.dekaino.net/screen/screen-4.0.2-patch-cjkwidth-cvs-2006052001 | |
patch < screen-4.0.2-deadlock-patch | |
patch < screen-4.0.2-hankanacopy-patch |
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 | |
cd ~/local/src | |
wget http://ftp.kaist.ac.kr/vim/unix/vim-7.3.tar.bz2 | |
bzip2 -d vim-7.3.tar.bz2 | |
tar xvf vim-7.3.tar | |
rm vim-7.3.tar | |
cd vim73/src | |
mkdir ~/local/vim73 | |
./configure --prefix=$HOME/local/vim73 --with-features=huge --enable-multibyte --enable-perlinterp --enable-pythoninterp --enable-multibyte |
NewerOlder