Skip to content

Instantly share code, notes, and snippets.

@merk
merk / Debug.php
Last active September 25, 2017 09:56
Debug helpers for Symfony2/Twig
<?php
namespace Infinite\Helper\Twig;
use Doctrine\Common\Util\Debug as DoctrineDebug;
class Debug extends \Twig_Extension
{
/**
* Returns a list of global functions to add to the existing list.
@henrikbjorn
henrikbjorn / phpunit.watchr
Created August 17, 2011 13:33
Save this in your project root and launch with the watchr gem `watchr phpunit.watchr`. This will now watch every test file for all bundles in src for changes and if a change is found it will run `phpunit -c app changedfile`
$ gem install watchr
$ cd /path/to/symfony-project
$ wget https://raw.github.com/gist/1151531/f12b125fed843086c05377d4f76185797121cbc6/phpunit.watchr
$ watchr phpunit.watchr
@iampersistent
iampersistent / gist:1119337
Created August 2, 2011 00:35
config for key value
->arrayNode('identifiers')
->useAttributeAsKey('key')
->prototype('scalar')
->end()
->end()
@ogawa
ogawa / socks-proxy.sh
Created August 1, 2011 11:16
This script for handling SSH-Socks Proxy on Mac OS X.
#!/bin/sh
#
# Step 1. Install proctools to use "pgrep" command.
#
# Step 2. Configure your .ssh/config to include:
#
# Host proxy-host
# HostName proxy-host.example.com
# User a12345
# DynamicForward localhost:1080
@richsage
richsage / gist:1069251
Created July 7, 2011 10:22
Behat step for logging in
$steps->Given('/^I am logged into the admin area as rich_81$/', function($world) {
$session = $world->getSession();
$doc = $session->getPage();
// Ensure we're logged out for cases where the session isn't
// reset between Behat steps
$session->visit($world->locatePath("/admin/logout"));
$session->visit($world->locatePath("/admin"));
@beberlei
beberlei / ActiveEntity.php
Created June 19, 2011 11:11
Doctrine 2.2 Traits Preview
<?php
use Doctrine\ORM\EntityManager,
Doctrine\ORM\Configuration,
Doctrine\ORM\Mapping\ClassMetadata;
/**
* Active Entity trait
*
* Limitations: a class can only ever be assocaited with ONE active entity manager. Multiple entity managers
@mvrhov
mvrhov / minimum.conf
Created April 13, 2011 08:33
nginx über config
server {
listen 80;
server_name <your.site.com>;
root /var/www/vhosts/<your.site.com>/site/www/;
#site root is redirected to the app boot script
location = / {
try_files @site @site;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}