Skip to content

Instantly share code, notes, and snippets.

/**
* @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')");
@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

@ricbra
ricbra / gist:39ad51dbaa2be90e56fd
Last active October 10, 2017 07:22
Install OpenCV on Ubuntu Trusty Vagrant box
sudo apt-add-repository ppa:jon-severinsson/ffmpeg
sudo apt-get update
sudo apt-get upgrade -y
version="$(wget -q -O - http://sourceforge.net/projects/opencvlibrary/files/opencv-unix | egrep -m1 -o '\"[0-9](\.[0-9]+)+' | cut -c2-)"
echo "Installing OpenCV" $version
mkdir OpenCV
cd OpenCV
echo "Removing any pre-installed ffmpeg and x264"
sudo apt-get -qq remove ffmpeg x264 libx264-dev
echo "Installing Dependenices"
@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
{
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: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
@ricbra
ricbra / gist:e25dae0e13e500816d5c
Last active August 29, 2015 14:08
Startup script for Selenium
### BEGIN INIT INFO
# Provides: selenium
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: selenium
# Description: selenium with xvfb
### END INIT INFO
#!/usr/bin/env sh
# we need to define our credentials here via environment vars as thats the way we get mysql
# credentials in Codeship.
if [ -z $SYMFONY__TEST_DATABASE_USER ]; then
export SYMFONY__TEST_DATABASE_USER=root
fi
if [ -z $SYMFONY__TEST_DATABASE_PASSWORD ]; then
export SYMFONY__TEST_DATABASE_PASSWORD=yourdevweakdbpass
fi
@ricbra
ricbra / gist:c4aa33e2e2cc9243ded8
Created October 31, 2014 20:33
app/config/config_test.yml
imports:
- { resource: config_dev.yml }
doctrine:
dbal:
dbname: "%test_database_name%"
driver: pdo_mysql
user: "%test_database_user%"
password: "%test_database_password%"
@ricbra
ricbra / gist:0e38f66ecac91f9573c0
Last active August 29, 2015 14:08
phpspec composer
{
"require": {
},
"require-dev": {
"sensio/generator-bundle": "~2.3",
"phpspec/phpspec": "~2.0",
"behat/behat": "~3.0",
"behat/symfony2-extension": "~2.0@dev",
"behat/mink-extension": "~2.0@dev",