Code snippets

You will find here 15 code snippets I find useful so I don't have to Google ™ or Stackoverflow ™ them when I need. There are also code snippets I always forget! 😁 Sometimes, related links to the code will be available. The main difference with other random snippets you will find on the web is that in most cases (for the Symfony related ones) you will be able to run them directly from this website to check the output so you can verify it works as expected ™.

This snippet shows how to wait for a Docker container to be ready, thanks to the inspect command. This is a script you can call ju...

Docker

Published on 2021-11-01 • Modified on 2021-11-01

 View the code


This snippet shows how to create a dynamic date depending on the current fixture with nelmio/alice. The trick is to use the $curre...

alice

Published on 2021-10-24 • Modified on 2021-10-24

 View the code


In this snippet, we see how to ignore platform requirements with composer. In a project I maintain, I did an update of a package, ...

composer

Published on 2021-09-15 • Modified on 2021-09-15

 View the code


In this snippet, we see how to replace text in a file with SED on macOS. Sometimes Unix commands do not behave exactly as they wou...

mac

Published on 2021-07-14 • Modified on 2021-07-14

 View the code


In this snippet, we see how to use the $current variable with the nelmio/alice fixtures library. $current is one the most helpful ...

alice

Published on 2021-07-10 • Modified on 2021-07-10

 View the code


In this snippet, we will see how to create a simple dateTime object with the Alice fixtures bundle. When you start to play with th...

Symfony

Published on 2021-04-03 • Modified on 2021-04-03

 View the code


In this snippet, we will see how to test if a Docker container is healthy in a Makefile. The goal is to use this check before runn...

Docker

Published on 2021-02-27 • Modified on 2021-02-27

 View the code


It's more a note than a snippet, but I wanted to have it at my disposal as I always forget. Also note that to delete the last stas...

GIT

Published on 2021-01-16 • Modified on 2021-01-16

 View the code


In this snippet, we will see how to prevent deploying when you have local changes, and you didn't push all your work to your deplo...

GIT

Published on 2021-01-05 • Modified on 2021-01-05

 View the code


In this snippet, we will see how to switch PHP version locally when using Brew for MacOS. I didn't use this a lot in the past beca...

PHP

Published on 2021-01-01 • Modified on 2021-01-01

 View the code