The C in CSS: cascading

The Cascade is a fundamental element of CSS: it means that in order to fully understand how an element will be rendered, a developer should be aware of how weight, specificity, and order will affect the process. In presence of multiple rules competing for the styling of an element, the…

Tips and tricks for Simple Storage Service S3

Simple Storage Service – S3 is one of the first services created by Amazon AWS, and it is also one of the most popular. Its simplicity has determined its great success. In addition to the most commonly used functions or methods of use, there are some functions or features that…

PHP tip: array_diff an array of objects

That’s tricky! Let’s assume we have two arrays like these:

Looking at these few lines I would expect that those two arrays are different but if we compare them with php array_diff function they’re the same:

This happens because array_diff compares array elements as string so it calls the __toString…

Amazon Managed Blockchain

Una delle tecnologie più recenti e più promettenti è quella della blockchain(Attenzione alla “B”, con la maiuscola si fa riferimento alla Blockchain di Bitcoin, con la “b” minuscola alla tecnologia blockchain dove l’asset di riferimento non è necessariamente il Bitcoin). In questo breve articolo non vi descriveremo, in modo dettagliato,…

Lightweight controllers everywhere in Symfony

The usual way of defining a controller in a default Symfony installation is by placing it in the src/Controller directory, but there might be situations where you just don’t want to do that. For instance, if you’re using some sort of domain-driven design and want to organize your project according…

Composition over inheritance: tackle the “Template Method”

In this article we’re gonna talk about composition over inheritance but not approaching this topic from a theoretical point of view (you can find dozens of good articles online by googling the topic), but instead by providing an example of something that in literature is a well-know pattern: Template Method….

Dependency injection – Come iniettare servizi taggati

Tagged services Per indicare che un servizio svolge un particolare ruolo in Symfony è possibile configurarlo aggiungendo uno o più tags alla sua definizione. Per esempio, etichettando un servizio con il tag twig.extension si indica a Symfony che il servizio deve essere trattato come una estensione di twig. Questo meccanismo…

TWIG: include VS embed VS macro

There are various types of code reuse in Twig but, what are the differences between them? In this article we’ll explore the differences between include, embed and macro. First of all, some definitions from the documentation: The include statement includes a template and returns the rendered content of that file…

1 2 7