Skip to content

Instantly share code, notes, and snippets.

View mghignet's full-sized avatar

Maxime Ghignet mghignet

View GitHub Profile
@mghignet
mghignet / restez-chez-vous-engagement-de-confidentialité
Last active April 14, 2020 17:40
Engagement de confidentialité - Apple - #restezChezVous
Engagement de confidentialité - Version du 14 Avril 2020
Collecte de données :
L'application RestezChezVous ne collecte aucune donnée personnelle.
Toutes les données nécessaires au fonctionnement de l'application sont stockées sur votre téléphone et ne sont en aucun cas envoyées à un service tiers.
@mghignet
mghignet / tiime-scripts
Created January 1, 2020 20:55
All scripts that can be useful to get the most out of Tiime
// Get the total number of kilometers for a year (in case the amount has been reinitialized)
// Run that in the Chrome console
Array.from(document.querySelectorAll(".table tr.ng-scope"))
.filter(row => row.querySelector("td:nth-of-type(1)").textContent.endsWith("2019"))
.map(row2019 => Number(row2019.querySelector("td:nth-of-type(3)").textContent))
.reduce((a, b) => a + b, 0)
@mghignet
mghignet / setup-elastic-name-autocomplete
Created August 24, 2018 08:26
Kibana commands to setup an Elastic index that handles autocompletion 👍
PUT customer
{
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 1
},
"analysis": {
"filter": {
"min_length_filter": {
@mghignet
mghignet / elastic-kibana-dev.sh
Last active October 3, 2021 18:17
Run a development Elastic and Kibana quickly
# Run a development Elastic and Kibana quickly
# Create a docker network for both containers to communicate
docker network create elastic
# Use OSS versions (the default ones include x-pack, that has to be configured, I couldn't get it working out of the box)
# Name your Elastic container and make it use the network your created
docker run --name smd-elastic -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" --network=elastic -d docker.elastic.co/elasticsearch/elasticsearch-oss:6.3.2
# Reference the name you gave to the Elastic container in the env variable and also make it use the network you created
@mghignet
mghignet / Guy
Last active April 7, 2017 14:52
# Dans votre .bashrc/.zshrc/.xxxrc/fichier d'alias...
alias guy=git
# Dans votre .gitconfig
[alias]
ajoute = add
tar = archive
bifurque = bisect
enquete = blame
branche = branch
# Modify any commit of your history in one command (shorthand)
# Put this in your .gitconfig
[alias]
fixup = !sh -c 'SHA=$(git rev-parse $1) \
&& git commit --fixup $SHA \
&& git rebase -i --autosquash $SHA~' -
# Usage: git fixup {sha1}
# Discard all changes on your local branch and go back to the version you have on the remote branch
# Put this in your .gitconfig
[alias]
dammit = !BRANCH=$(git rev-parse --abbrev-ref HEAD) \
&& git fetch origin $BRANCH \
&& git reset --hard origin/$BRANCH
# Usage: git dammit
▄████████████▄
▄██▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▄
▄██▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▄
▄▀███▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓████████████▄
▄▀█████████████████ ███████████████████████▓▓
██████▀ ▄██▄ ▀█████ ███████████▀ ▄██▄ ▀████▓▓
█████ ██████ █████ ███████████ ██████ ███
▀▀▀ ▀██▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀██▀ ▀▀
#!/bin/sh
set -e
trap exit_message TERM EXIT
# Shell colors, to use with printf function
declare -r BLACK='\033[1;30m'
declare -r RED='\033[1;31m'
declare -r GREEN='\033[1;32m'
declare -r YELLOW='\033[1;33m'

Keybase proof

I hereby claim:

  • I am mghignet on github.
  • I am mghignet (https://keybase.io/mghignet) on keybase.
  • I have a public key whose fingerprint is 8C5F 2586 5694 7DBF 8077 AD25 B64C F186 6574 E556

To claim this, I am signing this object: