Skip to content

Instantly share code, notes, and snippets.

Avatar

Joeri Timmermans pix-art

View GitHub Profile
@pix-art
pix-art / TimeoutContext.php
Created Jul 28, 2017
A timeout context to help you when you have to wait for elements on your page
View TimeoutContext.php
<?php
namespace FrontendBundle\Features\Context;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use Behat\Mink\Exception\ElementNotFoundException;
use Behat\Mink\Exception\ElementTextException;
use Behat\Mink\Exception\ResponseTextException;
use Behat\MinkExtension\Context\RawMinkContext;
class TimeoutContext extends RawMinkContext
View Global branch cleanup git
1. Create cleanup.sh somewhere with the following code:
git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d
2. Create global alias for that file:
git config --global alias.cleanup '!sh <location of your file>/cleanup.sh'
3. Checkout to your develop or master and run:
View gist:99c565a59f5ce6ecaa2d
$query = $this->em->getConnection()->createQueryBuilder()
->select('a.*')
->from('asset', 'a');
if ($type) {
$query->andWhere('a.type = :type')
->setParameter('type', $type);
}
$assets = $query->execute()->fetchAll();
@pix-art
pix-art / pre-commit
Created Nov 27, 2015
Pre commit hook that runs php-cs-fixer on your src folder (Symfony2)
View pre-commit
#!/bin/sh
BASE=$(git rev-parse --show-toplevel)
php-cs-fixer self-update
php-cs-fixer fix $BASE/src/ --level=symfony
@pix-art
pix-art / FakerContext.php
Last active Oct 12, 2015
Custom faker context with extra logging on failure
View FakerContext.php
<?php
namespace FrontendBundle\Features\Context;
use Behat\Behat\Hook\Scope\AfterScenarioScope;
use Behat\Gherkin\Node\TableNode;
use Behat\Symfony2Extension\Context\KernelAwareContext;
use Behat\Symfony2Extension\Context\KernelDictionary;
use Faker\Factory as FakerFactory;
View Bash History completion.md

##Open .inputrc

sudo vim ~/.inputrc

##Paste the following

"\e[A": history-search-backward
"\e[B": history-search-forward
View JMeter Server-Client setup with Docker-machine.md

##1. Setup docker

#Mac
https://docs.docker.com/installation/mac/

#Linux
https://docs.docker.com/installation/ubuntulinux/

##2. Setup docker-machine