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 | |
$watcher = new Symfony\Component\ResourceWatcher\ResourceWatcher; | |
// track any change inside directory: | |
$watcher->track('some/folder1', function($event) { | |
echo '['.$event->getType().'] '.$event->getResource()."\n" | |
}); |
<?php | |
namespace Behat\CommonContext; | |
use Behat\BehatBundle\Context\BehatContext; | |
use Behat\Behat\Event\ScenarioEvent; | |
use Doctrine\ORM\Tools\SchemaTool; | |
/** | |
* Provides hooks for building and cleaning up a database schema with Doctrine. |
{ | |
"require": { | |
"php": ">=5.3.2", | |
"symfony/http-kernel": "2.1-dev", | |
"symfony/routing": "2.1-dev" | |
} | |
} |
{ | |
"require": { | |
"behat/behat": ">=2.2.2", | |
"behat/mink": ">=1.3.2" | |
}, | |
"repositories": { | |
"behat/mink-deps": { "composer": { "url": "behat.org" } } | |
} | |
} |
<?php | |
/* | |
* Example usage of streamed response and post response code execution. | |
* | |
* @author Pierre Minnieur <pierre.minnieur@sensiolabs.de> | |
* | |
* @see https://github.com/symfony/symfony/pull/2791 | |
* @see https://github.com/symfony/symfony/pull/2935 | |
* @see https://github.com/sensio/SensioFrameworkExtraBundle/pull/86 |
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
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 | |
namespace Acme\DemoBundle\Features\Context; | |
use Behat\BehatBundle\Context\BehatContext, | |
Behat\Behat\Context\TranslatedContextInterface, | |
Behat\Behat\Exception\PendingException; | |
use Behat\Gherkin\Node\PyStringNode, | |
Behat\Gherkin\Node\TableNode; |
#!/usr/bin/env php | |
<?php | |
$paths = array(); | |
if (isset($_SERVER['argv'])) | |
{ | |
$paths = $_SERVER['argv']; | |
array_shift($paths); | |
if (!$paths) |
<?php | |
final class BlogPost | |
{ | |
private $created; | |
private $publish; | |
public function __construct() | |
{ | |
$this->created = new DateTime('now'); |