Skip to content

Instantly share code, notes, and snippets.

@ch3ric
ch3ric / .bashrc
Last active November 6, 2023 13:37
Git config and bashrc
# colored prompt with git branch
PS1='[\[\033[1;32m\]\u@\h\[\033[0m\]][\[\033[1;33m\]\w\[\033[0m\]]$(__git_ps1 "[\[\033[1;31m\]%s\[\033[0m\]]")\$ '
@ch3ric
ch3ric / MessageConsumer.php
Last active August 29, 2015 13:56
Publish RabbitMQ message from symfony 1 and Consume in Symfony 2
<?php
// src/Acme/ExportBundle/Services/Message/MessageConsumer.php
namespace Acme\ExportBundle\Services\Message;
use Monolog\Logger;
use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface;
use PhpAmqpLib\Message\AMQPMessage;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
@ch3ric
ch3ric / ExampleTest.php
Created May 16, 2013 18:56
Test a symfony1.4 project with PHPUnit and Symfony2 components. These Symfony2 components are needed: Symfony/Component/DomCrawler & Symfony/Component/CssSelector
<?php
// test/phpunit/ExampleTest.php
include(__DIR__ . "/../../lib/test/sfWebTestCase.class.php");
use Symfony\Component\DomCrawler\Crawler;
class ExampleTest extends sfWebTestCase
{