Skip to content

Instantly share code, notes, and snippets.

View asaokamei's full-sized avatar

Asao Kamei asaokamei

View GitHub Profile
@asaokamei
asaokamei / Tags.php
Created September 19, 2012 02:39
PHP HTML Tag Generator Class.
<?php
/**
* @method Tags a()
* @method Tags href()
* @method Tags target()
* @method Tags style()
* @method Tags div()
* @method Tags input()
* @method Tags value()
@asaokamei
asaokamei / DiInterface.php
Created September 15, 2012 00:39
Automatic Dependency Injection using Interface
<?php
/*
Example of simple automatic dependency injection using only interface.
this code is equivalent to:
$service = new \MyService\Service;
$invoice = new \Application\Invoice;
@asaokamei
asaokamei / ClassLoader.php
Created January 16, 2012 13:50
ClassLoader for PSR-0 using closure.
<?php
/**
* SPL Class Loader for NameSpace classes using closure.
* ex: spl_autoload_register( ClassLoader() );
* copied from https://gist.github.com/221634
* @param $path
* @param array $option
* @return closure
*/
@asaokamei
asaokamei / compare.php
Created December 11, 2011 12:32
compare __, arry, and _ww performance.
<?php
/**
* compare performance of underscore.php, arry.php, and _ww.php.
*/
require_once __DIR__ . '/../Underscore.php/underscore.php';
require_once __DIR__ . '/../arry/Arry.php';
require_once __DIR__ . '/../_ww/_ww.php';
/**