Skip to content

Instantly share code, notes, and snippets.

View mickaelandrieu's full-sized avatar
🏠
Working from home

Mickaël Andrieu mickaelandrieu

🏠
Working from home
View GitHub Profile
@mickaelandrieu
mickaelandrieu / sujets.md
Last active November 24, 2016 15:15
Propositions de sujets pour l'avent de l'afsy
  • Comment migrer vers Symfony3 ?
  • De meilleures applications avec le composant Workflow
  • La performance par défaut avec le composant Cache
  • Comment contribuer à Symfony?
  • Des applications performantes avec Blackfire
  • Silex 2, le micro framework simple et performant
  • Que peux-t-on attendre de Twig 2?
  • Gérez votre projet MonoRepo avec splitsh
  • Les projets de Fabien que vous ne connaissez peut être pas: Sami, Goutte, Sismo, PHP CS Fixer, MonoRepo, Pimple, Switmailer...
  • Object Calisthenics (aucune idée de la traduction fr exacte)
@mickaelandrieu
mickaelandrieu / yamllint.php
Created October 20, 2016 08:14 — forked from raulfraile/yamllint.php
YAML linter
<?php
<<<CONFIG
packages:
- "symfony/yaml: ~2.3"
CONFIG;
use Symfony\Component\Yaml\Exception\ParseException;
use Symfony\Component\Yaml\Parser;
$content = file_get_contents($argv[1]);
@mickaelandrieu
mickaelandrieu / response_body.json
Created October 6, 2016 11:32
Get all issues from a repository
[
{
"id": 1,
"url": "https://api.github.com/repos/octocat/Hello-World/issues/1347",
"repository_url": "https://api.github.com/repos/octocat/Hello-World",
"labels_url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/labels{/name}",
"comments_url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/comments",
"events_url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/events",
"html_url": "https://github.com/octocat/Hello-World/issues/1347",
"number": 1347,
<?php
use \ZipArchive;
/**
* @see http://php.net/manual/en/zip.constants.php
*/
class OpenFailureException extends \Exception
{
public static $errorCodeToMessage = array(
ZipArchive::ER_EXISTS => 'The file %filename% already exists. (ZipArchive::ER_EXISTS)',
<?php
/* minimal functional tests @author Mickaël Andrieu <mickael.andrieu@prestashop.com> */
stream_context_set_default(['http'=>['method'=>'HEAD']]);
function it($m,$p){echo"\033[3",$p?'2m✔︎':'1m✘'.register_shutdown_function(function(){die(1);})," It $m\033[0m\n";} // thanks everzet!
function ok($url){return false!==strpos(get_headers($url)[0], '200');}
// go tests !
it('GitHub Ok',ok('https://github.com/'));
@mickaelandrieu
mickaelandrieu / upgrade_to_symfony3-lts.md
Last active May 21, 2024 03:39
Migration guide to Symfony 3 LTS

Let's migrate a Symfony 2.8 LTS application to Symfony 3 LTS

Handle deprecations

First of all, ensure you don't have any deprecated!

The Symfony documentation explains it well, but let's sum up:

  • install the phpunit bridge ($ composer require --dev symfony/phpunit-bridge)
  • also check all your pages using web profiler and be ensure there is no deprecation error handled
  • found errors and need help about how to fix it ? I did a sort of guide.
sudo mount -t vboxsf <nom-patage> ~/<dossier-choisi>
@mickaelandrieu
mickaelandrieu / sf2_standalone_form.php
Last active November 26, 2015 15:17 — forked from jubianchi/sf2_standalone_form.php
How to use Symfony2 Form Component Standalone
<?php
namespace Standalone\Form;
use \Symfony\Component\HttpFoundation as SHttp;
use \Symfony\Component\Form as SForm;
use \Symfony\Component\DependencyInjection as SDI;
use \Symfony\Bridge as SBridge;
//Register all your autoloaded functions here
//...
<?php
// sources: http://stackoverflow.com/a/4719222
class A {
public static function className(){
echo __CLASS__;
}
public static function test(){
self::className();
}
RewriteCond %{DOCUMENT_ROOT}/../vendor/backbee/bb-core-js/$1 -f
RewriteRule ^/resources/toolbar/(.*)$ %{DOCUMENT_ROOT}/../vendor/backbee/bb-core-js/$1 [L]