Skip to content

Instantly share code, notes, and snippets.

@sandermarechal
sandermarechal / offcanvas.html.twig
Created January 13, 2015 13:38
foundation off-canvas KnpMenu
{% extends 'knp_menu.html.twig' %}
{% block list %}
{% if item.hasChildren and options.depth is not sameas(0) and item.displayChildren %}
{% import 'knp_menu.html.twig' as knp_menu %}
{% if item.level > 0 %}
{% set listAttributes = listAttributes|merge({'class': (listAttributes.class|default('') ~ ' left-submenu')|trim}) %}
{% else %}
{% set listAttributes = listAttributes|merge({'class': (listAttributes.class|default('') ~ ' off-canvas-list')|trim}) %}
{% endif %}
@sandermarechal
sandermarechal / AbstractTranslation.php
Last active December 17, 2015 19:29
Design idea for a new Doctrine Translatable extension
<?php
namespace Prezent\Translatable\Entity;
use Doctrine\ORM\Mapping as ORM;
use Prezent\Translatable\Entity\AbstractTranslation;
/**
* @ORM\MappedSuperClass
*/
@sandermarechal
sandermarechal / daemon
Created March 5, 2012 11:12
PHP problem using passthru() on bash script that uses process replacement
#!/bin/bash
# Start daemon, using a syslog file descriptor as logfile
# This causes the phing.php passthru() to hang
./daemon.php >(logger -t daemon.php)
# This will work fine from phing.php
# ./daemon.php out.log
@sandermarechal
sandermarechal / BarTest.php
Created July 18, 2011 14:15
PHPUnit Group Bugs
<?php
/**
* @group bar
*/
class BarTest extends PHPUnit_Framework_TestCase
{
/**
* @dataProvider spit
*/