Skip to content

Instantly share code, notes, and snippets.

😀
Happy

Grégoire Pineau lyrixx

😀
Happy
Block or report user

Report or block lyrixx

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lyrixx
lyrixx / HardCoreDebugLogger.php
Last active Aug 15, 2019
Hardcore Debug Logger
View HardCoreDebugLogger.php
<?php
const STREAM_OPEN_FOR_INCLUDE = 128;
final class HardCoreDebugLogger
{
public static function register(string $output = 'php://stdout')
{
register_tick_function(function () use ($output) {
$bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
@lyrixx
lyrixx / rootCA.pem
Created Feb 25, 2019
my rootCA.pem (mkcert)
View rootCA.pem
-----BEGIN CERTIFICATE-----
MIIEjTCCAvWgAwIBAgIQcxWNVb9OEeS51am6xUW6FzANBgkqhkiG9w0BAQsFADBf
MR4wHAYDVQQKExVta2NlcnQgZGV2ZWxvcG1lbnQgQ0ExGjAYBgNVBAsMEWdyZWdv
aXJlQGdyZWdvaXJlMSEwHwYDVQQDDBhta2NlcnQgZ3JlZ29pcmVAZ3JlZ29pcmUw
HhcNMTkwMTIzMTAyNjMzWhcNMjkwMTIzMTAyNjMzWjBfMR4wHAYDVQQKExVta2Nl
cnQgZGV2ZWxvcG1lbnQgQ0ExGjAYBgNVBAsMEWdyZWdvaXJlQGdyZWdvaXJlMSEw
HwYDVQQDDBhta2NlcnQgZ3JlZ29pcmVAZ3JlZ29pcmUwggGiMA0GCSqGSIb3DQEB
AQUAA4IBjwAwggGKAoIBgQDz7qMbfPDd3tn8Q1RYMZBuQiQclK/MRi9mwOT78rnw
Oy520t2VqThX6Cp47JnSgmglOQK0LuY2YuYXIVAMusnC5M+oP6vRK2H4DIFq/9Pc
HVIgPDsbx1e4hyEodqDK0G8Q0sufvmWqHu7olvHpXIVSvp+1nGtOgkJ8kTkjrHWR
@lyrixx
lyrixx / BrokerFactory.php
Last active Jul 1, 2019
PHPStan extension to extract property type hint from constructor argument
View BrokerFactory.php
<?php
use PHPStan\Broker\Broker;
use PHPStan\Broker\BrokerFactory as PhpstanBrokerFactory;
use PHPStan\Reflection\ClassReflection;
use PHPStan\Reflection\Php\PhpPropertyReflection;
use PHPStan\Reflection\PropertiesClassReflectionExtension;
use PHPStan\Reflection\PropertyReflection;
use PHPStan\Type\ObjectType;
@lyrixx
lyrixx / run.php
Last active Feb 26, 2019
Updated your templates with the new twig include
View run.php
<?php
<<<CONFIG
packages:
- "symfony/finder: ~3.0"
- "symfony/console: ~3.0"
CONFIG;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
@lyrixx
lyrixx / index.php
Created Aug 11, 2017
Box PHP calls
View index.php
<?php
class Foobar
{
public function success()
{
return $this->box('doSuccess', false, '123', '456');
}
public function fail()
@lyrixx
lyrixx / .gitignore
Last active Feb 24, 2017
Blackfire Upload
View .gitignore
/composer.json
/composer.lock
/vendor/
@lyrixx
lyrixx / Queue.php
Last active Mar 15, 2019
PHP async queue (Process (or not))
View Queue.php
<?php
class Queue
{
private $size;
private $onJobStart;
private $isJobRunning;
private $onJobFinish;
private $queued;
View run.php
<?php
<<<CONFIG
packages:
- "kriswallsmith/buzz: ^0.15.0"
- "symfony/console: ^3.2@dev"
CONFIG;
// Find you token on https://api.slack.com/docs/oauth-test-tokens
use Buzz\Message\Response;
View barcode.php
<?php
<<<CONFIG
packages:
- "zendframework/zend-barcode: ^2.5"
- "symfony/console: ^2.7"
CONFIG;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Helper\QuestionHelper;
@lyrixx
lyrixx / VersionCalculator.php
Last active Aug 29, 2015
VersionCalculator
View VersionCalculator.php
<?php
namespace SensioLabs\Toolkit\Assets;
use Assetic\AssetManager;
use Assetic\Asset\AssetCollection;
use Symfony\Component\Finder\Finder;
class VersionCalculator
{
You can’t perform that action at this time.