Skip to content

Instantly share code, notes, and snippets.

View thomasleveil's full-sized avatar

Thomas LÉVEIL thomasleveil

View GitHub Profile
thomasleveil / index.js
Last active November 14, 2020 23:33
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
exports.default = void 0;
var _default = process = {
env: {
NODE_ENV: "dev"
thomasleveil / .gitignore
Last active April 15, 2020 23:25
test apidaora
thomasleveil / index.html
Last active August 3, 2019 20:07
où sont passés mes revenus ?
<script type="text/javascript" src=""></script>
<script type="text/javascript">
// Scrollez vers le bas, jusqu'à la définition de la fonction "drawChart()"
thomasleveil /
Created March 7, 2019 21:57
Traefik as an automatic reverse proxy in a docker-compose project

Here's a setup using a reverse proxy so that you can use relative url (instead of messing with domain names in your webpages) and which also has the advantage of taking care of CORS issues you would have while making ajax calls to your backend.

If you are not familiar with reverse proxies, just know that all http requests should first hit the reverse proxy, and the reverse proxy will take care of forwarding those http requests to the correct http server following a set of rules.

In the docker world, a very convenient reverse proxy is Traefik.

thomasleveil / .gitlab-ci.yml
Last active March 6, 2019 21:27
Gitlab CI config for building Dockerfile
image: dockergit:latest
- docker version
- build
#- test
- publish
"config": ""
thomasleveil /
Last active October 17, 2022 07:44
getEventListenersStats() Chrome bookmarklet

getEventListenersStats() Chrome bookmarklet

Because I had a hard time finding the cause of a memory leak, I ended up making this bookmarlet to help find evidence of a memory leak caused by event listener not being removed on a webpage.

Once this bookmarklet is activated on your webpage, you will be able to call the getEventListenersStats() from the Chrome DevTools Console. This function will give you stats about all events listeners and handlers.

thomasleveil / docker-compose.yml
Last active February 1, 2020 18:36
docker healthchecks cheatsheet
test: ["CMD", "wget", "--retry-connrefused", "--tries=10", "--spider", "--server-response", "http://localhost"]
# wget --retry-connrefused --tries=10 --spider --server-response http://localhost:8080/
test: ["CMD", "curl", "--silent", "--show-error", "--fail", "--retry", "10", "--retry-connrefused", "--retry-delay", "5", "--retry-max-time", "30", "--head", "http://localhost:3000/login"]
# curl --silent --show-error --fail --retry 10 --retry-connrefused --retry-delay 5 --retry-max-time 30 --head http://localhost:3000/login
{"dashboard": {
"id": null,
"title": "Docker Containers",
"description": "Containers metrics",
"tags": [
"style": "dark",
"timezone": "browser",
"editable": true,