Skip to main content

Autosave feature in VSCode

2 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Autosave feature in VSCode

How many times have you modified a file in vscode (and forgotten to save the modification) in order to refresh it from your web page, run the script from your console, etc., and then thought Oh no, damn, it still doesn't work?

And it can take several minutes and back and forth before, damned, silly me, I didn't save my modification.

And even more so when you've done a Search&Replace in several files; some having been saved and others not.

Let's see how to avoid this.

Rendering a JSON file as a mind map

2 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Rendering a JSON file as a mind map

https://jsoncrack.com/editor

I really like the idea of not having to draw (actually, that is just because I am really bad at it) a diagram, a flow chart, a graphic representation of something that ... can be written.

Json crack is one of the tools in my toolkit when I want to draw something that can be written in json.

GitHub - Use Actions to deploy this blog

3 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

GitHub - Use Actions to deploy this blog

The last two months, I was using a FTP automation script to deploy the blog on my FTP server.

This way of doing things worked fine but had several inherent problems, the most important of which was that I had to run the script manually (from my computer).

If I modified an article directly from the Github interface or from another computer (where WinSCP was not installed, for example), there was no deployment.

By using Github actions, this problem no longer exists. With each push, the blog will be updated.

Getting the number of published posts

One min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Getting the number of published posts

Docusaurus didn't provide an easy way to retrieve the number of blog posts but there is well a trick.

There is an automatic page called archive like /blog/archive/.

On that page, all blog posts are displayed by year and months. With a document.querySelectorAll console instruction it's possible to make the count as suggested on https://github.com/facebook/docusaurus/discussions/9712

Don't query your PostgreSQL db anymore, prefer PostgREST

8 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Don't query your PostgreSQL db anymore, prefer PostgREST

Last year I had a large application developed in Laravel that required a MySQL database. When I was migrating to PostgreSQL I discovered PostgREST, which allowed me to completely remove queries from my code.

Don't get me wrong: my Laravel/PHP code was launching dozens of queries to the database and, after migration, none at all.

My tables, my models, my SQL queries, I was able to remove everything from my code. My PHP code has been greatly lightened and simplified.

Using variables from external file in your Quarto project

4 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Using variables from external file in your Quarto project

My use case is: I need to write some technical, long, documentation where I need to provide some information like IP addresses of used servers, some paths to the application, configuration folders, ...

The normal way to do this is to just put information directly in the documentation and to make sure to update every occurrence in case of changes during the lifecycle of the application.

The best way is probably to use an external file where information are stored in a key-value form and, during the rendering process of Quarto, replace short codes by values.

Happy New Year 2024

One min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Happy New Year 2024

I wish you all a very happy festive season, and may you continue to be curious about everything.

May this new year bring you new knowledge and skills, including Docker, Linux, Markdown and PHP.

May you take advantage of these technologies to create new projects and solve complex problems.

May you be surrounded by caring and inspiring people who will help you grow and succeed.

Above all, never stop being curious and learning.

All the best for you and your loved ones!

Customize your Linux prompt with Powerlevel10k

3 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Customize your Linux prompt with Powerlevel10k

When you're working with Linux (also working with WSL thus), there are many ways to personalize your prompt. One of the simplest solutions is to use Powerlevel10k and its wizard.

In this article we're going to use a Docker container just to : test and discard. The Docker container will only be used to install Powerlevel10k, configure it and play with it. After that, it's up to you to see whether you like the interface and, if you do, to redo the installation on your machine rather than in Docker.

The tip comes from here