Skip to content

Instantly share code, notes, and snippets.

View tentacode's full-sized avatar
🐙
tentacoding

Gabriel Pillet tentacode

🐙
tentacoding
View GitHub Profile
@tentacode
tentacode / gist:1389156
Created November 23, 2011 16:36
Une commande pour lancer des tests Behat
<?php
namespace Pmsipilot\TestBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand,
Symfony\Component\HttpKernel\Util,
Symfony\Component\Console\Input\InputArgument,
Symfony\Component\Console\Input\InputOption,
Symfony\Component\Console\Input\InputInterface,
Symfony\Component\Console\Input\ArrayInput,
@tentacode
tentacode / FusionArrayFormatter.php
Created January 13, 2012 09:46
Simple PropelFormatter independant of PropelCollection
<?php
class FusionArrayFormatter extends PropelFormatter
{
/**
* @param PDOStatement $stmt
* @return array
*/
public function format(PDOStatement $stmt)
{
@tentacode
tentacode / gist:1846089
Created February 16, 2012 16:07
Metastep and pystringnode ?
<?php
/**
* @When /^I add a resource on "([^"]*)" with:$/
*/
public function iAddAResourceOnWith($resource, TableNode $data)
{
$json = $this->getJsonFromTableNode($data);
$url = $this->getUrlFromResource($resource);
return array(
@tentacode
tentacode / composer.json
Created April 4, 2012 08:34 — forked from everzet/composer.json
Install Mink with ALL available drivers
{
"require": {
"behat/mink": "*",
"fabpot/goutte": "*",
"alexandresalome/php-selenium": "*",
"facebook/php-webdriver": "*",
"behat/sahi-client": "*"
},
@tentacode
tentacode / gist:2360369
Created April 11, 2012 16:29
Vidéo raoul
Scenario Outline: Video Raoul
Given I am connected on "sitevideo.com"
Then I check the <nth-video> video in my xml file "raoul.xml"
Examples:
| nth-video |
| 1 |
| 2 |
| 3 |
@tentacode
tentacode / gist:2654132
Created May 10, 2012 16:04
Definition qui plante
appDevDebugProjectContainer:Containerobject(Symfony\Component\DependencyInjection\Definition)#1846 (14) {
["class":"Symfony\Component\DependencyInjection\Definition":private]=>
string(48) "Symfony\Bridge\Doctrine\Mapping\Driver\XmlDriver"
["file":"Symfony\Component\DependencyInjection\Definition":private]=>
NULL
["factoryClass":"Symfony\Component\DependencyInjection\Definition":private]=>
NULL
["factoryMethod":"Symfony\Component\DependencyInjection\Definition":private]=>
NULL
["factoryService":"Symfony\Component\DependencyInjection\Definition":private]=>
<?php
class SomeObject
{
use \FooTraits\SomeTrait;
public function getSomeRequiredParameter()
{
return 'foo';
}
@tentacode
tentacode / list.html.twig
Created October 15, 2012 12:23
Twig recursive macro
{% macro recursiveCategory(category) %}
<li>
<h4><a href="{{ path(category.route, category.routeParams) }}">{{ category }}</a></h4>
{% if category.children|length %}
<ul>
{% for child in category.children %}
{{ _self.recursiveCategory(child) }}
{% endfor %}
</ul>
@tentacode
tentacode / UserExtension.php
Created October 31, 2012 13:43
Twig Extension to grant access based on path
<?php
namespace Tentacode\Foobar\UserBundle\Twig;
use Twig_Extension;
use Twig_Function_Method;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Http\AccessMap;
@tentacode
tentacode / gist:4117353
Created November 20, 2012 11:17
PHP 5.4 brew Mountain Lion
~$ apachectl -t
httpd: Syntax error on line 118 of /private/etc/apache2/httpd.conf: Cannot load /usr/local/Cellar/php54/5.4.0/libexec/apache2/libphp5.so into server: dlopen(/usr/local/Cellar/php54/5.4.0/libexec/apache2/libphp5.so, 10): Symbol not found: _environ\n Referenced from: /usr/local/Cellar/php54/5.4.0/libexec/apache2/libphp5.so\n Expected in: /usr/sbin/httpd\n in /usr/local/Cellar/php54/5.4.0/libexec/apache2/libphp5.so
~$ brew install php54 --with-mysql --with-intl --with-debug
==> Downloading http://www.php.net/get/php-5.4.8.tar.bz2/from/this/mirror
Already downloaded: /Library/Caches/Homebrew/php54-5.4.8
Warning: Backing up all known pear.conf and .pearrc files
Warning: If you have a pre-existing pear install outside
of homebrew-php, or you are using a non-standard
pear.conf location, installation may fail.