Skip to content

Instantly share code, notes, and snippets.

// Function to calculate the number of milliseconds left until 13:00 Paris time
function calculateMillisecondsLeft() {
const now = new Date();
const parisTime = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 13, 0, 0); // Set the desired time (13:00)
const timeUntilParisTime = parisTime - now; // Time difference until 13:00 Paris time
const millisecondsLeft = Math.floor(timeUntilParisTime);
return millisecondsLeft;
}
// Function to wait for the specified duration in milliseconds and then navigate
@RaphaelAudet
RaphaelAudet / tuto.md
Created April 5, 2022 07:51 — forked from barmic/tuto.md
Authentification par certificat avec nginx

Pour mettre en place une authentification par certificat avec nginx comme reverse proxy.

Création des certificats

Créer l'authorité de certification

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
@RaphaelAudet
RaphaelAudet / launch.json
Created October 20, 2020 08:14
Python launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "test_mauco_sequences",
"type": "python",
"request": "launch",
"stopOnEntry": false,
"pythonPath": "${workspaceRoot}/venv/bin/python",
@RaphaelAudet
RaphaelAudet / code_review_guidelines.md
Created September 22, 2020 08:26
Code review guideline

Code review guidelines

Based on a list Michael Azerhad published on linkedin.

  1. La portée des variables/méthodes/classes
  2. Les traces de muabilité là où l'immuabilité est plus adéquate
  3. L'indentation
  4. Le nommage des méthodes, classes et variables
  5. L'orthographe et la grammaire => très important
  6. Les duplications de code
@RaphaelAudet
RaphaelAudet / qadsrv.sh
Created October 25, 2018 08:27
quick and dirty server
#!/bin/bash
sudo apt-get install zsh
sudo apt-get install build-essential git-core tmux
sudo chsh ubuntu /usr/bin/zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
cd ~/.rbenv && src/configure && make -C src
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
~/.rbenv/bin/rbenv init
vi ../.zshrc
@RaphaelAudet
RaphaelAudet / random.coffee
Created February 20, 2018 10:07
random coffeescript tests
visibleY = (el) ->
`var el`
rect = el.getBoundingClientRect()
top = rect.top
height = rect.height
el = el.parentNode
loop
rect = el.getBoundingClientRect()
if top <= rect.bottom == false
@RaphaelAudet
RaphaelAudet / styles_regex
Created November 15, 2017 08:25
regex to match all inline styles in html
style=(["'])(?:(?=(\\?))\2.)*?\1
<!--[^>]*-->
data-identifier=(["'])(?:(?=(\\?))\2.)*?\1
data-index=(["'])(?:(?=(\\?))\2.)*?\1
class=(["'])(?:(?=(\\?))\2.)*?\1
compilesafe=(["'])(?:(?=(\\?))\2.)*?\1
tooltip=(["'])(?:(?=(\\?))\2.)*?\1
@RaphaelAudet
RaphaelAudet / cfnukes.sh
Last active June 12, 2017 09:52
CloudFoundry destroy apps and services onliners
# FIXME theses scripts dont really play well if the app or services names have spaces
# WARNING theses onlinerss are destructive, please dont copy/paste this without understanding what you are doing, k?
# alias to got to the cloud foundry bluemix test environment and remove all apps and all services with "example"
alias NukeBluemix="export CF_HOME=~/.cf/profiles/bluemix && \
cf apps | grep .eu-gb.mybluemix.net | awk '{print $1}' | xargs -n 1 cf d -f -r && \
cf s | grep example | awk '{print $1}' | xargs -n 1 cf ds -f"
# the same as above but for "example" services only
@RaphaelAudet
RaphaelAudet / tmux.conf
Created November 27, 2015 09:28
tmux.conf
# UTF-8
set-option -g status-utf8 on
set-window-option -g utf8 on
# Set 256-colour terminal
set -g default-terminal "screen-256color"
# windows starts at 1
set -g base-index 1
@RaphaelAudet
RaphaelAudet / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console