Skip to content

Instantly share code, notes, and snippets.

View brikou's full-sized avatar

Brice BERNARD brikou

  • Nancy, France
View GitHub Profile
@brikou
brikou / SketchSystems.spec
Last active April 18, 2021 09:56
stripe*
stripe*
loading*
LOADED -> waiting
waiting
mounting*
mounted -> waiting0
waiting0
@brikou
brikou / pre-commit.php-cs-fixer.bash
Created March 7, 2013 14:26
pre commit hook with php-cs-fixer
#!/usr/bin/env bash
EXIT_CODE=0
for FILE in `git status --porcelain | egrep '^[AM]' | egrep '\.(md|php|twig|xml|yml)$' | awk '{print $2;}'`; do
php-cs-fixer fix $FILE --verbose --dry-run
if [[ $? != 0 ]]; then
echo "f=$FILE; php-cs-fixer fix \$f --verbose && git add \$f"
# app/config/config.yml

framework:
    translator: ~
@brikou
brikou / gist:958702
Created May 6, 2011 09:50
constructor
<?php
$book = new Book(array(
'name' => 'Les aventures de François',
'status' => 'published',
'author' => new Author(array(
'name' => 'François',
'age' => '27',
)),
));
@brikou
brikou / disable address validation for known customer, in AcmePizzaBundle
Created April 6, 2011 12:07
Disable address validation for known customer, in AcmePizzaBundle
<?php
/**
* @param ExecutionContext $context
* @return bool
*/
public function isValidAddress($context)
{
if ($this->knownCustomer) {
$this->address = $this->em->getRepository('AcmePizzaBundle:Address')->findOneBy(array('phone' => $this->knownPhone));