Skip to content

Instantly share code, notes, and snippets.

View chalasr's full-sized avatar

Robin Chalas chalasr

View GitHub Profile
@chalasr
chalasr / abstract.md
Last active May 29, 2023 13:14
Getting the full power of Dependency Injection in Symfony 6.3

Getting ready for Symfony 7

2 years ago Symfony 6.0 was released. A lot has happened since then, paving the way for Symfony 7 is just around the corner, this workshop will introduce you to the most important changes that it ships after 2 years of work. of Symfony 6. important features and changes that have been shipped Let's features of the dependency injection container. You will also learn how to prepare a Symfony 4 app for version 5, to be released next November. EventDispatcher, Security, Cache, etc - many important components have been improved, which means some part of them have been deprecated, and replaced by updated interface.

Long gone are the days when Dependency Injection in Symfony was only about injecting the entire container everywhere. Now we write services that depend on what they really need, That's is what Dependency Injection is. a powerful yet complex pattern with the Inversion Of Control principle belonfs Symfony implements in a flexible

@chalasr
chalasr / oss-news.md
Last active November 27, 2022 18:03
Update on my OSS work - November 25, 2022

Hey sponsors!

Here is a quick update regarding what my OSS work has been focused on lately:

  • Symfony is smoothly integrating more modern (standard) authentication flows in core, especially OpenIDConnect. I've helped making the first step in Symfony 6.2: Adding a generic RFC6750-compliant Bearer Access Token authenticator (symfony/symfony#46428).
  • Next steps: Now helping someone contributing a built-in OIDC authenticator (symfony/symfony#48285), also a CAS authenticator (symfony/symfony#48276).
  • Also on the Security topic: I gave a talk at SymfonyCon in DisneyLand Paris about GNAP - The future of OAuth. Once the protocol goes stable, an integration will come into Symfony as well (WIP from me). It was my biggest conference so far :)
  • I started contributing to some Golang OSS, mostly to push forward a recent feature from HTTP that aims to improve application performances: [HTTP 103 Early Hints responses](https://www.fastly.com/blog/beyond-server-p
@chalasr
chalasr / UnixTimestampDateConversion.php
Last active March 10, 2021 04:50
Integer values for date claims using lcobucci/jwt v4
<?php declare(strict_types=1);
namespace App\JWT\Encoding;
use Lcobucci\JWT\ClaimsFormatter;
use Lcobucci\JWT\Token\RegisteredClaims;
class UnixTimestampDateConversion implements ClaimsFormatter
{
public function formatClaims(array $claims): array
@chalasr
chalasr / bootstrap.sh
Created April 29, 2020 13:09 — forked from keo/bootstrap.sh
Setup encrypted partition for Docker containers
#!/bin/sh
# Setup encrypted disk image
# For Ubuntu 14.04 LTS
CRYPTFS_ROOT=/cryptfs
apt-get update
apt-get -y upgrade
apt-get -y install cryptsetup
@chalasr
chalasr / script.lua
Created July 7, 2019 19:04 — forked from chanks/script.lua
Lua script to delete/trim all processed messages from a Redis stream
-- The goal of this script is to trim messages that have been processed by
-- all extant groups from the a given Redis stream. It returns the number
-- of messages that were deleted from the stream, if any. I make no
-- guarantees about its performance, particularly if the stream is large
-- and not fully processed (so a simple XTRIM isn't possible).
-- First off, bail out early if the stream doesn't exist.
if redis.call("EXISTS", KEYS[1]) == 0 then
return false
end
@chalasr
chalasr / build.md
Last active February 24, 2019 12:12
Build php 7.3 from source OSX

Checkout source

git clone https://github.com/php/php-src
cd php-src
git checkout php-7.3.0

Configure

./configure \
@chalasr
chalasr / README.md
Last active December 17, 2018 08:59
patch testing webhook ap
  • git apply le patch du dessus
  • run vendor/bin/phpunit --filter EnricherFacebookLead
@chalasr
chalasr / cache_twig.php
Created November 13, 2018 11:32
twig template cache
```php
class __TwigTemplate_fb1b3af49b743a22d4a8037a2f5c5aa7bd839febe71580bced4fa8443306e961 extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);
$this->parent = false;
$this->blocks = array(
@chalasr
chalasr / coroutine.php
Created October 27, 2018 21:00 — forked from nikic/coroutine.php
A coroutine example: Streaming XML parsing using xml_parser
<?php
error_reporting(E_ALL);
/* Data can be send to coroutines using `$coroutine->send($data)`. The sent data will then
* be the result of the `yield` expression. Thus it can be received using a code like
* `$data = yield;`.
*/
/* What we're building in this script is a coroutine-based streaming XML parser. The PHP
@chalasr
chalasr / Symfony2 GraphvizDumper demo
Created June 7, 2017 14:50 — forked from fgm/Symfony2 GraphvizDumper demo
Demonstrate how to use the GraphViz Dumper in a Symfony 2.4 project.
<?php
/**
* @file
* gvdump.php
*
* @author: Frédéric G. MARAND <fgm@osinet.fr>
*
* @copyright (c) 2014 Ouest Systèmes Informatiques (OSInet).
*
* @license MIT