Some tips for django
Posted on 2018-05-21 in Trucs et astuces • Tagged with Python, Web, Django
Continue reading
Posted on 2018-05-21 in Trucs et astuces • Tagged with Python, Web, Django
Posted on 2018-03-07 in Trucs et astuces • Tagged with JavaScript
Sommaire
Rely on String.prototype.normalize().
const str = "Crème Brulée" str.normalize('NFD').replace(/[\u0300-\u036f]/g, "") > 'Creme Brulee'
Posted on 2018-03-07 in Trucs et astuces • Tagged with PostgreSQL, Database, SQL
Sommaire
Use the jsonb_set(COLUMN_NAME, PATH_TO_CHANGE, VALUE) function. The value must be a valid value in JSON (ie use '500' for numbers, 'true' for …
Posted on 2018-02-25 in Programmation • Tagged with Docker, Linux
Today I am going to explain how you can run multiple docker daemons on the same host. This can be useful if you want several users to use docker and want each of them to be isolated from one another (ie don't see images, containers, … of other users). The solution …
Posted on 2017-11-26 in Programmation • Tagged with php, Docker, security
At work in a PHP application, we rely on libsodium to erase a password from $_POST. It may sound like a good idea: once the password is not in memory any more, it can't leak. But the question is: is it really erased from memory? That's the question will answer …
Posted on 2017-08-20 in Trucs et astuces • Tagged with gitlab, ci, Python
By default, pip cache will be in ~/.pip. However, this folder cannot be cached by Gitlab. The trick is to force pip to use a folder located in the build directory with the --cache-dir option. You can then cache this folder.
For instance, you can use .pip as in the …
Posted on 2017-08-19 in Trucs et astuces • Tagged with nginx
location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ { if ( $http_origin ~* (https?://(.+\.)?(domain1|domain2|domain3)\.(?:me|co|com)$) ) { add_header "Access-Control-Allow-Origin" "$http_origin"; } }
Posted on 2017-08-19 in Aurelia • Tagged with aurelia, rollbar
I recently integrated Rollbar (a service to Detect, diagnose and debug errors with ease) into an Aurelia application. I explain here how I did it. I start by explaining how logging works with Aurelia and then how I integrated Rollbar into this.
Posted on 2017-08-14 in Aurelia • Tagged with ionic2, angular2, aurelia, framework7, android, mobile
This is a follow up to my Small comparison of ionic2 and Aurelia + Framework7 for hybrid mobile applications article where I compared ionic2 and Aurelia with Framework 7 for building an hybrid applications. At the time, Aurelia UX was not yet ready (and we were expecting a different, closed source …
Posted on 2017-08-08 in Trucs et astuces • Tagged with GPG, securité
Voici deux fonctions bash qui permettent de chiffrer et déchiffrer un fichier ou un dossier avec GPG.
Les dossiers sont compressés dans une archive ZIP avant le chiffrement.
Le chiffrement laisse les fichiers d'origine intacts. Le déchiffrement laisse le fichier chiffré intact.
Ces fonctions auront leur place dans votre .bashrc …