Skip to content

Instantly share code, notes, and snippets.

View cordoval's full-sized avatar

Luis Cordova cordoval

View GitHub Profile

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 ..
<?php
/**
* sfValidatorZip validates a zip code.
*
* @author Brent Shaffer <bshafs@gmail.com>
*/
class sfValidatorZip extends sfValidatorRegex
{
class FormFieldManager
{
/**
* Recria fields com rebra de bloqueio.
*
* @param FormInterface $sourceForm
* @param FormInterface $child
*/
public function rebuildChild(FormInterface $sourceForm, FormInterface $child)
{
use Symfony\CS\FixerInterface;
use Symfony\CS\Tokens;
class ShortArraySyntaxFixer implements FixerInterface
{
public function fix(\SplFileInfo $file, $content)
{
$tokens = Tokens::fromCode($content);
for ($index = 0, $c = $tokens->count(); $index < $c; $index++) {
@cordoval
cordoval / .gitignore
Last active August 29, 2015 14:02
Starting with components
/vendor

Configure

xdebug.ini

xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
<?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;
/**