Skip to content

Instantly share code, notes, and snippets.

View joelwurtz's full-sized avatar

Joel Wurtz joelwurtz

View GitHub Profile
@joelwurtz
joelwurtz / amqp-with-signal.php
Last active March 2, 2024 11:33
amqp-with-signal.php
<?php
$shouldStop = false;
pcntl_signal(SIGINT, function ($signo) use (&$shouldStop) {
var_dump('SIGINT received');
$shouldStop = true;
});
pcntl_signal(SIGTERM, function ($signo) use (&$shouldStop) {

Hello,

AbstractObjectNormalizer has a long list of ongoing issues and pull request, we got a talk at Paris Symfony Live with @dunglas @fbourigault and @soyuka on how we want to move forward, here is a resume of our talk and what we would like to achieve for the future:

Current State and Context

At the origin this normalizer was done for API Platform and many other third party libraries / project, in order to have a normalizer that is able to normalize and denormalize any data object (specifically doctrine entities). ObjectNormalizer, PropertyNormalizer and GetSetMethodNormalizer were already existing, but were having slightly different beahvior, that's why two abstract class were created AbstractNormalizer and AbstractObjectNormalizer

Over time, lots of missing features in the ObjectNormalizer were added on both the AbstractObjectNormalizer and the AbstractNormalizer as these features were also needed there.

FROM alpine:3.4
RUN apk --update add python py-pip && \
rm -rf /var/cache/apk
RUN pip install Sphinx --no-cache-dir && \
pip install sphinx_rtd_theme --no-cache-dir && \
pip install alabaster --no-cache-dir && \
pip install sphinx_bootstrap_theme --no-cache-dir
@joelwurtz
joelwurtz / gist:c06bcfbb6766cb2b1d53
Last active March 27, 2018 13:59
Zlib Stream PHP WTF :/
<?php
// Filter for zlib compress (RFC 1950)
stream_filter_append($resource, 'zlib.deflate', ['window' => 15]);
// Filter for deflate (RFC 1951)
stream_filter_append($resource, 'zlib.deflate', ['window' => -15]);
// Filter for gzip (RFC 1952)
stream_filter_append($resource, 'zlib.deflate', ['window' => 31);
@joelwurtz
joelwurtz / cmd
Created April 7, 2015 16:53
Environments with fabric
$ fab -l
Available commands:
production.cleannn
production.deploy
staging.deploy
@joelwurtz
joelwurtz / run.sh
Created December 9, 2014 14:46
Rabbitmq as a service under docker (altmost right) :/
#!/bin/bash
chown -R rabbitmq:rabbitmq /data/log
chown -R rabbitmq:rabbitmq /data/mnesia
HOSTNAME=$(hostname)
PID_FILE="/data/mnesia/rabbit\@$HOSTNAME.pid"
function start()
{
<?php
header('Content-type: application/octet-stream');
header('Content-Disposition: attachment; filename="backup.sql"');
passthru('mysqldump --all-databases');
@joelwurtz
joelwurtz / gist:5188891
Created March 18, 2013 17:09
php.ini.erb file example for chef cookbook
[PHP]
;;;;;;;;;;;;;;;;;;;;
; Language Options ;
;;;;;;;;;;;;;;;;;;;;
engine = On
short_open_tag = Off
asp_tags = Off
precision = 14
y2k_compliance = On