Skip to content

Instantly share code, notes, and snippets.

View havvg's full-sized avatar

Toni Uebernickel havvg

View GitHub Profile
<?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());
<?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.
*/
class DATABASE_CONFIG {
/**
@havvg
havvg / 11-symfony.conf
Created November 7, 2010 01:36
lighttpd symfony configuration w/ file existence lookup
server.modules += ("mod_rewrite", "mod_magnet")
@havvg
havvg / symfony.phpunit.xml
Created December 3, 2010 19:36
An example PHPUnit configuration file for symfony projects running on 512MB phpUnderControl server
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
colors="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="true">
<filter>
<blacklist>
@havvg
havvg / JsonpFilter.php
Created December 15, 2010 10:45
A simple JSONP filter for symfony web applications.
<?php
class JsonpFilter extends sfFilter
{
public function execute($filterChain)
{
// nothing to do before the action is called
$filterChain->execute();
if (($response = $this->getContext()->getResponse()) instanceof sfWebResponse and ($request = $this->getContext()->getRequest()) instanceof sfWebRequest)
@havvg
havvg / TrafficLights.pde
Created January 6, 2011 19:27
Basic Arduino sketch implementing two cross linked traffic lights.
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
havvg / cctrlworker
Created February 5, 2011 23:58
A simple wrapper for the new cloudcontrol API provided by cctrlapp version 1.0.0, showing current workers and their command line information.
#!/bin/bash
APP=$1
for worker in `cctrlapp $APP worker | grep -ve '^Workers' | grep -ve '^ nr\.' | tr -s " " | cut -f3 -d " "`;
do
cctrlapp $APP worker $worker | grep -v "There is no such worker for this app_name/deployment_name."
done;
@havvg
havvg / 004_ExampleMigration.php
Created February 12, 2011 18:15
an example migration file for sfCloudControlPlugin using sfPropelMigrationsLightPlugin
<?php
/**
* Migrations between versions 003 and 004.
*/
class Migration004 extends sfMigration
{
/**
* Migrate up to version 004.
*/
@havvg
havvg / .gitignore
Last active March 22, 2016 19:24
global gitignore
# Mac OS X
.DS_Store
# ZSH Plugins
.phing_targets
# Automatic backup files
*~.nib
*.swp
*~
*(Autosaved).rtfd/
# Eclipse
<?php
abstract class BaseFormFilterPropel extends sfFormFilterPropel
{
public function setup()
{
parent::setup();
foreach ($this->getFields() as $eachFieldName => $eachFieldType)
{