Skip to content

Instantly share code, notes, and snippets.

@ricbra
ricbra / gist:01f312345da3a426d171
Created November 5, 2014 19:52
Ansible playbook for Selenium headless on Debian Wheezy
---
- name: Instal Selenium
tasks:
- apt_repository: repo="deb http://downloads.sourceforge.net/project/ubuntuzilla/mozilla/apt all main" state=present
- apt_key: id="C1289A29" keyserver=keyserver.ubuntu.com state=present
- apt: name=iceweasel state=absent
- apt: name={{ item }} state=present update_cache=yes
with_items:
- firefox-mozilla-build
- openjdk-7-jre-headless
simpleCart({
cartColumns: [
{ attr: "price" , label: "Price", view: 'currency' } ,
{ view: "decrement" , label: false , text: "-" } ,
{ attr: "quantity" , label: "Qty" } ,
{ view: "increment" , label: false , text: "+" } ,
]
});
@ricbra
ricbra / gist:7478a267296aeef45108
Created January 9, 2015 21:32
Example rabbitmq-cli-consumer command
namespace Wb\Bundle\CoreBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class MailConsumerCommand extends ContainerAwareCommand
{
@ricbra
ricbra / gist:c53a91edd5c9606a025c
Last active August 29, 2015 14:15
Installing Logentries using Ansible

Installing logentries using Ansible

In this small tutorial I'll describe the steps required to install the Logentries agent using Ansible. This tutorial assumes you have some basic knowledge about Ansible and how to use playbooks and roles. If you're unfamiliar with these topics please consult the Ansible documentation.

Example playbook

Consider the following directory structure, representing an example playbook as starting point, based on the Ansible best practices:

.

|-- group_vars

/**
* @When /^I click on toolbox item "([^"]*)"$/
*/
public function iClickOnToolBoxItem($locator)
{
$session = $this->getSession();
$page = $session->getPage();
$toolbox = $page->find('css', '.toolbox');
$nodes = $page->findAll('css', "a:contains('Versturen')");
<?php
/*
* (c) Waarneembemiddeling.nl
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Wb\Pool\Model\Member;
<?php
namespace spec\Wb\PoolBundle\Controller;
use Broadway\CommandHandling\CommandBusInterface;
use Broadway\ReadModel\RepositoryInterface;
use Broadway\UuidGenerator\UuidGeneratorInterface;
use Netvlies\WbBundle\Entity\EntityGroupRepository;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
@ricbra
ricbra / Doctrine.php
Last active August 29, 2015 14:23 — forked from Sitebase/Doctrine.php
\Doctrine\DBAL\Types\Type::addType('uuid', 'BuboBox\Doctrine2\DBAL\Types\UuidType');
<?php
/*
* (c) Waarneembemiddeling.nl
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Wb\Bundle\CoreBundle\SwiftMailer;
@ricbra
ricbra / hack.php
Created August 14, 2015 12:42
How to set violation with array
<?php
namespace SmaakEnSensatie\Validator;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
class DeliveryValidator extends ConstraintValidator
{
public function validate($value, Constraint $constraint)