Skip to content

Instantly share code, notes, and snippets.


Luis Cordova cordoval

View GitHub Profile

Keybase proof

I hereby claim:

  • I am cordoval on github.
  • I am cordoval ( on keybase.
  • I have a public key ASBZeLM1EAhwJs9O_Rm-RS0WjBFZp7f0liKWL9ufT4RMogo

To claim this, I am signing this object:

cordoval / gist:f2f1890100c8c6d89a8540b1e2c658df
Created Oct 25, 2017 — forked from giannisp/gist:ebaca117ac9e44231421f04e7796d5ca
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
View gist:f2f1890100c8c6d89a8540b1e2c658df
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
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 ..
View gist:82a0f43a4c2dd1073b79
* sfValidatorZip validates a zip code.
* @author Brent Shaffer <>
class sfValidatorZip extends sfValidatorRegex
View FormFieldManager
class FormFieldManager
* Recria fields com rebra de bloqueio.
* @param FormInterface $sourceForm
* @param FormInterface $child
public function rebuildChild(FormInterface $sourceForm, FormInterface $child)
View ShortArraySyntaxFixer.php
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 / .gitignore
Last active Aug 29, 2015
Starting with components



View changelog.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);
View CommandContext.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;