Why you probably want to make a SPA

Posted on 2020-01-12 in Programmation • Tagged with JavaScript, Web, Django

Important

I created an updated version of this article in should you build a SPA which provides a more complete and balanced view on this subject. Please read it instead of this current article.

I am currently working professionally on a website that is not a SPA. I'd like to …


Continue reading

Writing a PWA with Aurelia

Posted on 2019-09-01 in Aurelia • Tagged with JavaScript, TypeScript, Aurelia, Mobile, PWA

I feel like Progressive Web Application (PWA for short) are a more and more popular way to build mobile apps. That's understandable since you can use the same technology you use to build a SPA to build one! So …


Continue reading

Some thoughts on Aurelia Store

Posted on 2019-08-24 in Aurelia • Tagged with JavaScript, TypeScript, Aurelia, RxJS

On my spare time, I am developing a board game that uses the Aurelia framework. I currently manage the state in a service without any dedicated state management solutions (like RxJS, Aurelia store, Redux, …). And I feel I am reaching to the limit of what I can do with it …


Continue reading

Issues while writing tests for a component using i18n

Posted on 2019-08-04 in Aurelia • Tagged with JavaScript, TypeScript, Aurelia, i18N

Some time ago, I wanted to add some tests (behavior and render) on an Aurelia component that uses the i18n plugin and more precisely the df attribute in the view to display a localized date.

Since it was a while back (I wanted to write it earlier but couldn't), my …


Continue reading

Extract translations from your Aurelia app

Posted on 2019-08-03 in Aurelia • Tagged with JavaScript, TypeScript, Aurelia, i18N

If you use Aurelia with the i18n plugin, you will have to maintain JSON files that will map a translation key to an actual translation. Manually editing the file to add/remove keys can be tedious.

Luckily, keys can be extracted automatically thanks to i18next-scanner. It can extract translation keys …


Continue reading

CSS tips

Posted on 2019-03-10 in Trucs et astuces • Tagged with CSS

Apply style to IE11 only

Put the style in this media query:

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    // Put CSS here
}

PyCharm tips

Posted on 2019-03-10 in Trucs et astuces • Tagged with Python, IDE, PyCharm

View print output immediately

Add PYTHONUNBUFFERED=1 in run config or .env (only use .env if you use the plugin). This is meant to immediately view the output …


Continue reading

ZSH tips

Posted on 2018-10-09 in Trucs et astuces • Tagged with ZSH, Shell, Linux

ZBell

Useful to have a notification when a long command completes.

To enable it, add zbell to your plugins array if you are using oh-my-zsh or source the definition file.

To configure:

  • The minimum time commands must take for the notification to happen, use: ZBELL_DURATION. For instance ZBELL_DURATION …

Continue reading

Bash tricks

Posted on 2018-10-03 in Trucs et astuces • Tagged with Bash, Shell, Linux

Scripts

Use this at the top of all your Bash scripts to avoid problems:

# Exit on error.
set -e
# Don't allow undefined variable.
set -u
# Make pipeline fail if any command in it fail.
set -o pipefail

Heroku tips

Posted on 2018-10-03 in Trucs et astuces • Tagged with devops, Heroku

Use an editor

By default there is no editor on Heroku. To get one, you can use the heroku-nano plugin like this (or by installing as a plugin):

mkdir bin
cd bin
curl https://github.com/Ehryk/heroku-nano/raw/master/heroku-nano-2.5.1/nano.tar.gz --location --silent > nano.tar …

Continue reading