cat .git/objects/dd/f452dc1825ed7b0dca08b9a322174b3394644d | php -r 'echo gzuncompress(stream_get_contents(fopen("php://stdin","r")));'
This file contains hidden or 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
... .htaccess | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} -f | |
RewriteRule ^(.*\.html)$ file.php?target=$1 [QSA,L] | |
#敢えてファイルが存在するときで、末尾に.htmlが付くファイルの場合のみリライトさせる | |
</IfModule> | |
This file contains hidden or 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 | |
$fd = inotify_init(); | |
$desc = inotify_add_watch($fd,"directory",IN_CLOSE_WRITE); | |
chdir(__DIR__); | |
array_shift($_SERVER["argv"]); | |
$command = __DIR__ . "/" . join(" ", $_SERVER["argv"]); | |
while($events = inotify_read($fd)) | |
{ |
This file contains hidden or 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
#controller/doctrine_controller.php | |
<?php | |
class DoctrineController extends AppController{ | |
public $name = "Doctrine"; | |
public function index() | |
{ | |
//AppModelで登録してあるようなのでひっぱる | |
$em = $this->Doctrine->doctrineConn; | |
$article = new Model\Article(); |
This file contains hidden or 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
set nocompatible | |
filetype indent plugin on | |
syntax on | |
set number | |
set hidden | |
set wildmenu | |
set showcmd | |
set hlsearch | |
set nomodeline |
This file contains hidden or 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
git clone https://github.com/libgit2/libgit2.git libgit2 | |
cd libgit2 | |
./waf configure | |
./waf build-shared | |
./waf install-shared | |
# see also | |
# http://libgit2.github.com/api.html#index | |
# libgit2を使ったgitのインデックスファイルの捜査でSegmentation Faultが起きちゃう。 |
This file contains hidden or 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 | |
/** | |
svn co http://svn.php.net/repository/inotify/trunk php-inotify | |
cd php-inotify | |
phpize && ./configure && make | |
sudo make install | |
# add "extension = inotify.so" to your php config. | |
# and modify this script. | |
php monitor.php | |
*/ |
This file contains hidden or 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 | |
/** | |
KyotoTycoon PHP Bindingののパフォーマンスチェック | |
**/ | |
$count = 1000; | |
////////////////////////////////////////////////////////////////////////////////////////////////// | |
printf("[Kyoto\\Tycoon\\HttpClientのテスト]\n"); | |
$client = new Kyoto\Tycoon\HttpClient(); |
This file contains hidden or 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
#ifdef HAVE_CONFIG_H | |
#include "config.h" | |
#endif | |
#include <php.h> | |
#include <ext/standard/info.h> | |
#include <Zend/zend_extensions.h> | |
/* | |
メモるよ! | |
#from zend/Zend.h |
This file contains hidden or 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
# git リポジトリ内でそれっぽいディレクトリ名に移動する | |
function j() | |
{ | |
top_dir=`git rev-parse --show-cdup` | |
path=`git ls-tree -rd --name-only --full-tree $(git rev-parse HEAD) | grep ${1}$` | |
result=$? | |
if [ ${result} -eq 0 ]; then | |
echo "# jumping to [${path}]"; | |
cd ${top_dir}${path} |