Commits that change formatting are a pain in git because they make using git blame much harder. It turns out, you can ask git to ignore these commits when running git blame with the --ignore-rev option and passing it a commit hash. You can even do things better and create …
If you need to load a specific font in a component, you can use this hook. It will return true when the fonts are loaded. It relies on the document.fonts API to load the fonts. If the fonts are already loaded, the promise will be fulfilled immediately and the …
If you deploy multiple Django websites on your infrastructure on various subdomains, you may get issues with invalid CSRF tokens. This is happening either because:
You erase the cookie by using the same domain. For instance, if you have your prod API at api.jujens.eu and pre-production one at …
Here is a small script to allow you to easily check that a domain you manage is correct (ie responds correctly, is available with IPv4 and IPv6, only supports TLS 1.2+…). It even has some color built in! You can, of course, adapt it to fit your needs.
Here are some security tips to check for backend services. It's mostly meant so that I can have a check list. So I don't develop them much but provide extra links where necessary. I also probably expand this list as time goes one and I learn more about this subject …
When you deploy a frontend app, most of the time the names of your assets contain their hash so you can easily cache the files. So instead of just having main.js you will have something like main.1234.js. The problem is that your HTML will reference main.1234 …
If you need to store a datetime range in Django (for instance, from which day to which day a listing is valid), instead of relying on two fields like valid_from and valid_to, you can use a single field validity_range of type DateRangeField. This way, both values are stored …
I recently deployed a React app in kubernetes. It was initially deployed directly in a public bucket: I have an API that is already hosted on kubernetes, but the app itself is made only of static files, so it made sense. However, requirements for my app changed and I required …