Skip to content

Instantly share code, notes, and snippets.

Avatar

Akihito Koriyama koriym

View GitHub Profile
@koriym
koriym / gist:1064403
Created Jul 5, 2011
vimをsudoで開き直したいとき
View gist:1064403
:w !sudo tee %
@koriym
koriym / gist:1064407
Created Jul 5, 2011
macportsメンテ
View gist:1064407
sudo port sync
sudo port selfupdate
sudo port clean --dist outdated
sudo port upgrade outdated
sudo port -u uninstall
@koriym
koriym / putinit.php
Created Jul 7, 2011
Put require scirpt each dir
View putinit.php
<?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 Jul 8, 2011
色々なフレームワークでフォーム
View form_url.txt
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
View BEAR.Sunday.design.md
@koriym
koriym / .gitignore
Created Aug 4, 2011
.gitignore for BEAR/OSX
View .gitignore
.project
.DS_Store
.buildpath
.settings/
Thumbs.db
htdocs/__*
htdocs/.htaccess
htdocs/emoji/
logs/*.log
logs/pagelog.sq3
@koriym
koriym / download_voice.php
Created Sep 21, 2011
Download voice of elePHPant interview files.
View download_voice.php
<?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 Oct 23, 2011
PHP用DIコンテナRayテスト
View gist:1307280
必要なもの
* PHP 5.3+ / 5.4
* phpunit
以下のコマンドをターミナルで入力します。
$ mkdir raytest
$ cd raytest
$ git clone git@github.com:koriym/Ray.Di.git
@koriym
koriym / gist:1390719
Created Nov 24, 2011
List of colors for prompt and Bash
View gist:1390719
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 Feb 16, 2012
xdebug src install
View gist:1842980
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が入らなかった時