Skip to content

Instantly share code, notes, and snippets.

View marijn's full-sized avatar

Marijn Huizendveld marijn

View GitHub Profile
@everzet
everzet / resource_watcher_usage.php
Created November 29, 2011 22:40
Symfony2.1 ResourceWatcher usage example
<?php
$watcher = new Symfony\Component\ResourceWatcher\ResourceWatcher;
// track any change inside directory:
$watcher->track('some/folder1', function($event) {
echo '['.$event->getType().'] '.$event->getResource()."\n"
});
@jakzal
jakzal / FeatureContext.php
Last active September 16, 2018 07:22
Generating schema before Behat scenarios in Symfony2
<?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.
@igorw
igorw / composer.json
Created December 12, 2011 10:42 — forked from beberlei/composer.json
A minimal Symfony Components Framework
{
"require": {
"php": ">=5.3.2",
"symfony/http-kernel": "2.1-dev",
"symfony/routing": "2.1-dev"
}
}
@everzet
everzet / composer.json
Created December 22, 2011 08:56
Install & use Behat+Mink with ALL dependencies through Composer
{
"require": {
"behat/behat": ">=2.2.2",
"behat/mink": ">=1.3.2"
},
"repositories": {
"behat/mink-deps": { "composer": { "url": "behat.org" } }
}
}
@immutef
immutef / UserController.php
Created December 22, 2011 15:21
[Symfony2] example usage of streamed response and post response code execution
<?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
@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// 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'];
@ziadoz
ziadoz / awesome-php.md
Last active May 10, 2024 15:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@everzet
everzet / FeatureContext.php
Created January 26, 2012 16:28
Describing your Symfony2 console commands with BehatBundle
<?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;
@edorian
edorian / clean-use.php
Created February 3, 2012 08:56 — forked from lapistano/clean-use.php
Script to clean unnecessary PHP use statements
#!/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');