Skip to content

Instantly share code, notes, and snippets.


Toni Uebernickel havvg

View GitHub Profile
havvg / services.yml
Created Oct 17, 2014
TraceableEventDispatcher using service decorator
View services.yml
class: Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher
- @container
public: false
class: Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher
decorates: event_dispatcher
havvg / CommandContext.php
Created May 30, 2015
BDD: Create User Command
View CommandContext.php
namespace Trnd\Behat\Context\Console;
use Behat\Behat\Context\Context;
use Mockery\MockInterface;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputInterface;
View ExampleTaskTest.php
require_once(dirname(__FILE__) . '/../bootstrap/task.php');
# load fixtures of this plugin
$propelData->loadData(sfConfig::get('sf_plugins_dir') . '/yetAnotherPlugin/data/fixtures');
$limeTest = new lime_test(1, new lime_output_color());
$task = new ExampleTask($dispatcher, $formatter);
$task->run(array(), array());
View database.php
* Cake database configuration for git repositories.
* It automatically detects the current working branch and uses the appropriate database connection.
* Fallback is given by the "default" entry.
havvg / JsonpFilter.php
Created Dec 15, 2010
A simple JSONP filter for symfony web applications.
View JsonpFilter.php
class JsonpFilter extends sfFilter
public function execute($filterChain)
// nothing to do before the action is called
if (($response = $this->getContext()->getResponse()) instanceof sfWebResponse and ($request = $this->getContext()->getRequest()) instanceof sfWebRequest)
havvg / TrafficLights.pde
Created Jan 6, 2011
Basic Arduino sketch implementing two cross linked traffic lights.
View TrafficLights.pde
class TrafficLight
* Accessors for traffic lights.
* Each of these values define the index, where to find a given part of the respective traffic light.
static const int green = 0;
static const int yellow = 1;
static const int red = 2;
havvg / cctrlworker
Created Feb 5, 2011
A simple wrapper for the new cloudcontrol API provided by cctrlapp version 1.0.0, showing current workers and their command line information.
View cctrlworker
for worker in `cctrlapp $APP worker | grep -ve '^Workers' | grep -ve '^ nr\.' | tr -s " " | cut -f3 -d " "`;
cctrlapp $APP worker $worker | grep -v "There is no such worker for this app_name/deployment_name."
havvg / 004_ExampleMigration.php
Created Feb 12, 2011
an example migration file for sfCloudControlPlugin using sfPropelMigrationsLightPlugin
View 004_ExampleMigration.php
* Migrations between versions 003 and 004.
class Migration004 extends sfMigration
* Migrate up to version 004.
View BaseFormFilterPropel.class.php
abstract class BaseFormFilterPropel extends sfFormFilterPropel
public function setup()
foreach ($this->getFields() as $eachFieldName => $eachFieldType)
havvg / ExampleTest.php
Created Mar 31, 2011
An adapter implementation used by the sfWebBrowserPlugin for testing purposes.
View ExampleTest.php
* A simple example test case using the sfTestAdapter.
* @author "Toni Uebernickel" <>
class ExampleTest extends PHPUnit_Framework_TestCase