Skip to content

Instantly share code, notes, and snippets.

Avatar
🐼
🐼 🐼 🐼

Alexis Lefebvre alexislefebvre

🐼
🐼 🐼 🐼
View GitHub Profile
@alexislefebvre
alexislefebvre / FullTextSearchFilter.php
Last active Aug 11, 2020 — forked from masseelch/FullTextSearchFilter.php
(Kind of a) api-platform full-text search filter.
View FullTextSearchFilter.php
<?php
namespace App\Filter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface;
use ApiPlatform\Core\Exception\InvalidArgumentException;
use Doctrine\ORM\QueryBuilder;
@alexislefebvre
alexislefebvre / extract.py
Created Dec 11, 2018
Extract translations from Symfony XLF file to tab-separated plain text
View extract.py
# -*- coding: utf-8 -*-
import xml.etree.ElementTree as ElementTree
filePath = 'translations/messages.fr.xlf'
f = open(filePath, 'r')
prefix = '{urn:oasis:names:tc:xliff:document:2.0}'
View patch.diff
diff --git a/Test/ValidationErrorsConstraint.php b/Test/ValidationErrorsConstraint.php
index 7b494f9..ad7656e 100644
--- a/Test/ValidationErrorsConstraint.php
+++ b/Test/ValidationErrorsConstraint.php
@@ -12,9 +12,10 @@
namespace Liip\FunctionalTestBundle\Test;
// BC
-class_alias('\PHPUnit_Framework_Constraint', '\PHPUnit\Framework\Constraint\Constraint');
+//class_alias('\PHPUnit_Framework_Constraint', '\PHPUnit\Framework\Constraint\Constraint');
@alexislefebvre
alexislefebvre / .travis.yml
Last active Feb 2, 2021
Skip builds on Travis CI with "[skip travis]"
View .travis.yml
sudo: false
language: php
git:
depth: 5
php:
- 7.0
View symfony_mysqldump.sh
#!/bin/bash
# See http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/23905052#23905052
ROOT=$(readlink -f $(dirname "$0"))
cd $ROOT
# Get database parameters
dbname=$(grep "database_name" ./app/config/parameters.yml | cut -d " " -f 6)
dbuser=$(grep "database_user" ./app/config/parameters.yml | cut -d " " -f 6)