Skip to content

Instantly share code, notes, and snippets.

View koriym's full-sized avatar

Akihito Koriyama koriym

View GitHub Profile
@koriym
koriym / gist:1064403
Created July 5, 2011 07:25
vimをsudoで開き直したいとき
:w !sudo tee %
@koriym
koriym / gist:1064407
Created July 5, 2011 07:26
macportsメンテ
sudo port sync
sudo port selfupdate
sudo port clean --dist outdated
sudo port upgrade outdated
sudo port -u uninstall
@koriym
koriym / putinit.php
Created July 7, 2011 06:03
Put require scirpt each dir
<?php
// en: Put require scirpt each dir in case of you can't rely default include_path. (Script use relative path.)
// ja: デフォルトのincludeパスが使用できない場合に各ディレクトリにrequireのみを相対パスで行うファイルを配置します。
//
// config
$initFileName = 'App.php';
$initFilePath = '../../';
// /config
// main
@koriym
koriym / form_url.txt
Created July 8, 2011 18:09
色々なフレームワークでフォーム
Zend Framework
http://framework.zend.com/manual/ja/zend.form.forms.html
Yii
http://www.yiiframework.com/doc/guide/1.1/ja/form.builder
SolarPHP
http://at-byte.com/technology/solarphp-basic-user-authentication-example
Symfony2
@koriym
koriym / BEAR.Sunday.design.md
Created July 28, 2011 16:15
BEAR.Sunday design
@koriym
koriym / .gitignore
Created August 4, 2011 01:43
.gitignore for BEAR/OSX
.project
.DS_Store
.buildpath
.settings/
Thumbs.db
htdocs/__*
htdocs/.htaccess
htdocs/emoji/
logs/*.log
logs/pagelog.sq3
@koriym
koriym / download_voice.php
Created September 21, 2011 00:06
Download voice of elePHPant interview files.
<?php
for ($i = 1; $i < 36; $i++) {
$filename = "vote_" . sprintf("%03d", $i) . '.mp3';
echo "$filename.";
$a = file_get_contents("http://voices.of.the.elephpant.s3.amazonaws.com/{$filename}");
file_put_contents($filename, $a);
}
@koriym
koriym / gist:1307280
Created October 23, 2011 11:54
PHP用DIコンテナRayテスト
必要なもの
* PHP 5.3+ / 5.4
* phpunit
以下のコマンドをターミナルで入力します。
$ mkdir raytest
$ cd raytest
$ git clone git@github.com:koriym/Ray.Di.git
@koriym
koriym / gist:1390719
Created November 24, 2011 05:57
List of colors for prompt and Bash
List of colors for prompt and Bash
txtblk='\e[0;30m' # Black - Regular
txtred='\e[0;31m' # Red
txtgrn='\e[0;32m' # Green
txtylw='\e[0;33m' # Yellow
txtblu='\e[0;34m' # Blue
txtpur='\e[0;35m' # Purple
txtcyn='\e[0;36m' # Cyan
txtwht='\e[0;37m' # White
@koriym
koriym / gist:1842980
Created February 16, 2012 07:31
xdebug src install
git clone https://github.com/derickr/xdebug.git
cd xdebug
phpize
./configure --enable-xdebug --with-php-config=/usr/local/php/bin/php-config
make
make install
OSXにPHP5.4をバイナリインストールしたあとにxdebugが入らなかった時