Skip to content

Instantly share code, notes, and snippets.

View cordoval's full-sized avatar

Luis Cordova cordoval

View GitHub Profile
@cordoval
cordoval / behat.sh
Created November 23, 2011 16:44 — forked from Stubbs/behat.sh
Behat Bash Autocompletion
#
# Add this to your /etc/bash_completion.d directory for behat parameter auto completion.
#
_behat()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
@cordoval
cordoval / gist:3123010
Created July 16, 2012 14:22
Diff parser
<?php
$diff = 'diff --git a/README.md b/README.md
index 9b6fc2a..cac3d88 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,34 @@
-*This project is not stable, tested or production ready. It\'s a proof of concept and a work in progress.*
+** This project is not stable, tested or production ready. It\'s a proof of concept and a work in progress. **
@cordoval
cordoval / gist:3487715
Created August 27, 2012 11:32 — forked from predakanga/gist:3487705
Calling command from controller
<?php
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
/**
* @Route("/test")
*/
@cordoval
cordoval / bdd-experiment-guide.md
Created September 9, 2011 16:38 — forked from havvg/bdd-experiment-guide.md
Behavior Driven Development in Symfony2 with Behat, Mink and Zombie.js

Description

This guide will show how to setup a new web application project with:

  • git, a distributed version control system.
  • Symfony2 framework
  • Behat, a tool for behavior driven development.
  • Mink, a tool unifying access to browser emulators wrapping them into one API.
  • Zombie.js, a browser emulator.
  • PHPUnit, the de-facto standard test suite in the PHP world.

Keybase proof

I hereby claim:

  • I am cordoval on github.
  • I am cordoval (https://keybase.io/cordoval) on keybase.
  • I have a public key ASBZeLM1EAhwJs9O_Rm-RS0WjBFZp7f0liKWL9ufT4RMogo

To claim this, I am signing this object:

@cordoval
cordoval / gist:f2f1890100c8c6d89a8540b1e2c658df
Created October 25, 2017 11:48 — forked from giannisp/gist:ebaca117ac9e44231421f04e7796d5ca
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
@cordoval
cordoval / test.sh
Created May 20, 2017 01:07 — forked from kadel/test.sh
kubectl create -f test.yaml
#secret "postgres-files-secret" created
#statefulset "postgres-statefulset" created
kubectl exec -it postgres-statefulset-0 /bin/sh
ls -lah /var/lib/postgresql/
# total 12
# drwxr-xr-x 3 root root 4.0K May 19 16:02 .
# drwxr-xr-x 3 root root 4.0K May 19 16:02 ..
@cordoval
cordoval / GroupBy.php
Created October 5, 2011 22:35 — forked from anonymous/GroupBy.php
Grouping filter for Twig.
<?php
namespace BlackRook\TaskBundle\Twig\Extension;
use DateTime,
Twig_Extension,
Twig_Environment,
Twig_TemplateInterface,
Twig_Error_Runtime,
Twig_Filter_Method;
<?php
$token = '<yourtoken>';
// Find latest version
exec('git tag', $tags, $return);
usort($tags, 'version_compare');
$latest = array_pop($tags);
// Get commits since latest version
exec('git log ' . $latest . '...HEAD --oneline', $commits, $return);
<?php
namespace MFB\Behat\Subcontext;
use Behat\Gherkin\Node\PyStringNode;
use Behat\MinkExtension\Context\RawMinkContext;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\EventDispatcher\EventDispatcher;
/**