helm create portail-web
This will generate a helm chart structured like:
portail-web/
Chart.yaml
values.yaml
function serializeForm(form) { // Serialize inputs values into json object | |
var obj = {}; | |
var formData = new FormData(form); | |
for (var key of formData.keys()) { | |
obj[key] = formData.get(key); | |
} | |
return obj; | |
}; |
help: ## Show this help | |
@grep -E "^[a-z0-9_-]+:|^##" Makefile | sed -E 's/([a-z0-9_]+):.*##(.*)/\1:\2/' | column -s: -t | sed -e 's/##//' | |
## | |
## Utils | |
sync: ## sync | |
rsync -azP --exclude={.git/,build}./ [email protected]:/root/engine | |
sync_gcp: ## sync in gcp VM (pre-req gcloud compute config-ssh) | |
rsync -Pavz --exclude={'data','*.pyc','prototypes','.git','.pytest_cache'} ./ sshuser@`gcloud compute instances list --filter="name=elasticsearch" --format "get(networkInterfaces[0].accessConfigs[0].natIP)"`:~/horizon |
#!/usr/bin/env bash | |
set -e | |
### Youtube | |
URLS=( | |
"https://www.youtube.com/watch?v=YbH1E2R9TOM" | |
"https://www.youtube.com/watch?v=fdNYW23Vm_c" | |
"https://www.youtube.com/watch?v=gh0faLFKl3w" | |
"https://www.youtube.com/watch?v=Homukj0sBYU" |
#!/usr/bin/env python | |
# Using a pivot | |
# Place value lower than pivot to the left, greater to the right | |
# Sort left and right recursively | |
def quick_sort(arr): | |
less, equal, greater = [], [], [] | |
if len(arr) > 1: | |
pivot = arr[0] |
# General | |
unameOut="$(uname -s)" | |
case "${unameOut}" in | |
Linux*) machine=Linux;; | |
Darwin*) machine=Mac;; | |
CYGWIN*) machine=Cygwin;; | |
MINGW*) machine=MinGw;; | |
*) machine="UNKNOWN:${unameOut}" | |
esac |
#!/usr/bin/env bash | |
sudo docker run --rm -p 3306:3306 --name=mysql \ | |
-e MYSQL_ROOT_PASSWORD="1234" \ | |
-e MYSQL_DATABASE="test" \ | |
-e MYSQL_USER="test" \ | |
-e MYSQL_PASSWORD="1234" \ | |
-d mysql/mysql-server --default-authentication-plugin=mysql_native_password | |
sudo docker logs -f mysql |
/** | |
* @argument callback function | |
* @argument arg argument | |
* @argument onMessageCallback function | |
* usage: runInWorker(function(e){return JSON.parse(e);}, '{"name": "toto"}', console.log); | |
**/ | |
function runInWorker(callback, arg, onMessageCallback){ | |
var blob = new Blob(['onmessage=function(_e){postMessage('+ callback.toString() + '(_e)); close();']); | |
var worker = new Worker(URL.createObjectURL(blob)); | |
worker.onmessage = onMessageCallback; |
#!/usr/bin/env bash | |
removevolumes() { | |
sudo docker volume rm $(sudo docker volume ls -qf dangling=true) | |
sudo docker volume ls -qf dangling=true | xargs -r sudo docker volume rm | |
} | |
removenetwork() { | |
sudo docker network ls | |
sudo docker network ls | grep "bridge" |
#!/usr/bin/env bash | |
# Prepare the videos to be used over http with the MPEG-DASH protocol | |
# The vp9 codec is used for the videos because h265 is not supported by chrome and h264 is too big | |
# This script generates webm files | |
## DOCS | |
# https://developers.google.com/media/vp9/settings/vod/ | |
# https://developer.mozilla.org/en-US/docs/Web/HTML/DASH_Adaptive_Streaming_for_HTML_5_Video | |
# http://wiki.webmproject.org/adaptive-streaming/instructions-to-playback-adaptive-webm-using-dash |