Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
<?php //Run as command line. Input file as first argument. | |
const G_FOO = 'aeiou'; //Googlon special letters | |
const G_INV = 'z'; //Preposition invalidator | |
const G_PREP = 3; //Preposition size | |
const G_VERB = 8; //Verb size | |
const G_ORDER = 'qnbczxjtklmvhrwfsdgp'; //Letter ordering | |
const G_NUM_MOD = 4; //Pretty number divisor | |
const G_NUM_MAX = 526593; //Pretty number minimum | |
$textB = explode(' ', file_get_contents($argv[1])); |
<?php | |
add_action( 'after_setup_theme', 'bootstrap_setup' ); | |
if ( ! function_exists( 'bootstrap_setup' ) ): | |
function bootstrap_setup(){ | |
add_action( 'init', 'register_menu' ); | |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
<?php | |
use FooBar\Test\Mock; | |
// In the sample below, $mock expects the method "sayHelloTo" to be called one time | |
// with the parameter $name equals "Alexandre" and return "Hello Alexandre" | |
$mock = (new Mock)([ | |
'sayHelloTo' => function($name="Alexandre") { | |
return "Hello Alexandre"; |
<?php | |
use Respect\Transform\Transformer as t; | |
$users = array( | |
array("id" => 1, "first_name" => "Alexandre", "last_name" => "Silva", "location" => "São Paulo"), | |
array("id" => 2, "first_name" => "Satoshi", "last_name" => "Silva", "location" => "Curitiba"), | |
array("id" => 3, "first_name" => "Fulano", "last_name" => "Silva", "location" => "New York") | |
); |
<?php | |
use Respect\Rest\Router; | |
use Respect\Relational\Mapper; | |
use Respect\Template\Xml; | |
use Respect\Template\Html; | |
$db = new Mapper(new PDO)); | |
$db->postsBase = $db->select('id', 'title', 'text')->posts( | |
$db->select('name', 'bio')->author) |
/* Véi, foca no código | |
.---. | |
/o o\ | |
__(= " =)__ | |
//\'-=-'/\\ | |
) (_ | |
/ `"=-._ | |
/ \ ``"=. |
<?php | |
class FluentCache extends \ArrayObject | |
{ | |
private $cache; | |
public function __construct(\Doctrine\Common\Cache\Cache $cache, array $data = array()) | |
{ | |
$this->cache = $cache; | |
parent::__construct($data, static::ARRAY_AS_PROPS); |