Skip to content

Instantly share code, notes, and snippets.

View lyrixx's full-sized avatar
😀

Grégoire Pineau lyrixx

😀
View GitHub Profile
@lyrixx
lyrixx / README.md
Last active April 11, 2024 21:52
slugger CLI

Slugger

This "project" is a simple CLI slugger

image

@lyrixx
lyrixx / LogMiddleware.php
Last active August 6, 2024 22:19
UUID processor for symfony
<?php
namespace App\Middleware;
use App\Middleware\Stamp\LogStamp;
use App\Monolog\Processor\UuidProcessor;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Middleware\MiddlewareInterface;
use Symfony\Component\Messenger\Middleware\StackInterface;
@lyrixx
lyrixx / index.php
Last active February 19, 2024 06:37
How to call private command method in Symfony ?
#!/usr/bin/env php
<?php
require __DIR__ . '/../../vendor/autoload.php';
use Castor\Console\Command\CompileCommand;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Command\Command;
// We extends the CompileCommand, to be able to remove the constructor, because
@lyrixx
lyrixx / CHANGELOG-3.0.md
Last active June 3, 2024 07:53
Symfony CHANGELOG

Bridge/Doctrine

  • removed EntityChoiceList
  • removed $manager (2nd) and $class (3th) arguments of ORMQueryBuilderLoader
  • removed passing a query builder closure to ORMQueryBuilderLoader
  • removed loader and property options of the DoctrineType

Bridge/Monolog

  • deprecated interface Symfony\Component\HttpKernel\Log\LoggerInterface has been removed
@lyrixx
lyrixx / README.md
Last active February 13, 2023 10:39
[GitHub] Bookmarklet to mark all files in a PR a "viewed"

Add the following bookmark:

javascript:boxes=document.getElementsByClassName("js-reviewed-checkbox"),counter=0;for(let e=0;e<boxes.length;e++){const t=boxes[e];!t.checked&&(t.click(),counter++)}alert("Folded "+counter);

Then click on it to mark all "viewed" checkbox to checked

@lyrixx
lyrixx / README.md
Last active August 18, 2022 08:41
How to "control" auto-completion in Google Chrome address bar?

How to "control" auto-completion in Google Chrome address bar?

For a while, when I type g in the address bar, it suggests me the following URL

https://github.com/foobar/hello/projects/9

But I don't want this URL at the first position. I don't even use this URL!

@lyrixx
lyrixx / ContainerTest.php
Last active May 22, 2024 11:23
Test applications services can boot
<?php
namespace Tests\Integration;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
@lyrixx
lyrixx / test.php
Last active July 18, 2024 09:51
Symfony Playgound with its Container and a custom configuration
<?php
use App\Kernel;
require __DIR__.'/vendor/autoload_runtime.php';
use Symfony\Component\Console\Output\StreamOutput;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@lyrixx
lyrixx / watch.sh
Created July 22, 2022 13:54
Watch dir and copy on change
watch -n 1 cp -u -R ./source ./dest
# Run every seconds: `-n 1`
# Copy everything from "source" to "dest":
# `-R ./source ./dest`
# But only if the content is different `-u`
@lyrixx
lyrixx / README.md
Last active March 22, 2022 14:01
PHP + Stream Wrapper + Stream Filter // Reproducer

PHP + Stream Wrapper + Stream Filter // Reproducer

Reproducer for php/php-src#8219

Usage

Run php index.php

Output