Skip to content

Instantly share code, notes, and snippets.

View thomasleveil's full-sized avatar

Thomas LÉVEIL thomasleveil

View GitHub Profile
@thomasleveil
thomasleveil / index.js
Last active November 14, 2020 23:33
NODE_ENV dev
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = process = {
env: {
NODE_ENV: "dev"
@thomasleveil
thomasleveil / .gitignore
Last active April 15, 2020 23:25
test apidaora
__pycache__
/.vscode
__pycache__
.pytest_cache
log.txt
@thomasleveil
thomasleveil / index.html
Last active August 3, 2019 20:07
où sont passés mes revenus ?
<html>
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
///////////////////////////////////////////////////////////////////////////////////////////
//
// Scrollez vers le bas, jusqu'à la définition de la fonction "drawChart()"
//
///////////////////////////////////////////////////////////////////////////////////////////
@thomasleveil
thomasleveil / README.md
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
thomasleveil / .gitlab-ci.yml
Last active March 6, 2019 21:27
Gitlab CI config for building Dockerfile
image: dockergit:latest
before_script:
- docker version
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
stages:
- build
#- test
- publish
{
"config": "https://via.placeholder.com/150"
}
@thomasleveil
thomasleveil / README.md
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
thomasleveil / docker-compose.yml
Last active February 1, 2020 18:36
docker healthchecks cheatsheet
healthcheck:
test: ["CMD", "wget", "--retry-connrefused", "--tries=10", "--spider", "--server-response", "http://localhost"]
# wget --retry-connrefused --tries=10 --spider --server-response http://localhost:8080/
healthcheck:
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": [
"docker"
],
"style": "dark",
"timezone": "browser",
"editable": true,