RAG explained to my mum

Old library with ladder, metaphor for RAG explained simply

Imagine someone who has read every university library in Switzerland. They can answer almost any general knowledge question. But if you ask them what happened at your place last week, or what’s in your internal documents, they have no idea. They weren’t there, and no one showed them. That’s RAG explained simply: the gap this … Read more

A Chrome extension to find unanswered WhatsApp chats

Person holding a smartphone showing a messaging app — illustration for an article about a Chrome extension to find unanswered WhatsApp chats

I recently opened WhatsApp Web and counted: 52 conversations where someone was waiting on a reply from me, lost in hundreds of group chats and notifications. The native filter strip (All / Unread / Favorites / Groups) does not have a “to reply” view. Unread only catches genuinely unread messages, not the ones I opened … Read more

Symfony – Debug the value of an environment variable

In Symfony you can define some configuration in the .env file. To be sure of the value the program actually receives at runtime, there is the following command php bin/console debug:container –env-var=DATABASE_URL –env=test With this command you can easily see the value Symfony uses php bin/console debug:container –env-var=DATABASE_URL Symfony Container Environment Variables ======================================= // Displaying … Read more

Symfony – Doctrine – How to see where an SQL query is executed

MacBook avec code sur un bureau

When using Doctrine, it is sometimes important to find where an SQL query is executed. Just turn on profiling_collect_backtrace on the connection, in the development configuration (config/packages/dev/doctrine.yaml): doctrine: dbal: connections: default: profiling_collect_backtrace: true Keep it for development only: collecting the call stack on every query is expensive. It relies on profiling, which is on by … Read more

Drupal 7: Create a datetime field in a schema with db_create_table

To create a table in Drupal 7, you can use the “my_module_update_7000” hook in the “my_module.install” file. The datetime type is unfortunately not mapped, which is why you have to use the “mysql_type” key const MY_MODULE_TABLE_NAME = ‘my_module_table’; function get_my_module_schema(): array { return [ ‘description’ => ‘description’, ‘fields’ => [ ‘id’ => [‘type’ => ‘serial’, … Read more

Install drupal/console on drupal 9

MacBook avec code sur un bureau

The drupal/console package was never made fully compatible with Drupal 9, and its development has now stopped. If you are starting a recent project, the command-line reference is now Drush. The modern solution: Drush Drush is actively maintained and compatible with Drupal 9, 10 and beyond: composer require drush/drush You then access the commands through … Read more

PHP Spaceship Operator <=>

Code sur écran d'ordinateur

A little-known but very useful operator, for example to sort an array, is the spaceship operator: <=> It compares two values and returns an integer (-1, 0, 1) depending on the result. $a < $b returns -1 $a = $b returns 0 $a > $b returns 1 One way to see it is here: https://3v4l.org/WcRSo … Read more

Categories PHP