Skip to content

Instantly share code, notes, and snippets.

@lhoang
lhoang / README.md
Last active April 16, 2021 09:33
Datalake Last Code Challenge

Avec WhatsApp/FB qui fait n'importe quoi avec nos données, il fallait qu'on trouve un moyen de communiquer de manière sécurisée une dernière fois.

Voici un compte-rendu du point Data Eng où on a mis le protocole Phantom en place.

Aga : On dirait que le fichier en input contient des nombres entre 0 et 999. Tiens, c'est pas un beau rectangle. Et si on reformait le rectangle ?

Jalil : Comment on connait la largeur ?

@lhoang
lhoang / Readme.md
Last active December 17, 2020 17:07
Exo Optimisation Scala

Optimisation Performance Scala

Tiré d'Advent of Code 2020 : https://adventofcode.com/2020/day/15

Enoncé: Suite de Van Eck

Chacun son tour, les joueurs disent un nombre. Ils commencent par une liste prédéfinie (input). Puis les règles suivantes s'appliquent:
en considérant le nombre qui vient d'être cité, si c'est la première fois que le nombre a été cité, le joueur dit 0, sinon le joueur annonce il y a combien de tours que le nombre a été cité pour la dernière fois.

@lhoang
lhoang / Readme.md
Last active November 18, 2020 23:03
Bookmarklet The Crew BGA

Description

Ce bookmarklet permet d'afficher les cartes restantes à jouer pour The Crew - Board Game Arena. Pas vraiment de la triche, à partir de la mission 25, on passe son temps à regarder la log pour savoir ce qu'on a joué. Version FR/EN

From: https://gist.github.com/metaflow/363fda250c6593a671cd328ecd3bb630

Instructions

  1. Créer un favori
  2. Editer l'url et copier la line du fichier thecrew.js : javascript:(function()....
@lhoang
lhoang / git.txt
Last active January 5, 2021 08:59
Git configuration
git config --global http.proxy http://proxy:3128
git config --global user.name "user name"
git config --global user.email "id@email.fr"
git config --global alias.lola 'log --graph --decorate --pretty=oneline --abbrev-commit --all'
git config --global alias.undo '!f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f'
git config --global pull.rebase true
git config --global rerere.enabled true
# Unix
@lhoang
lhoang / fib.scala
Created May 2, 2019 13:52
Fibonacci in Scala
def fib(p: Int): List[Int] = {
def recFib(list: List[Int], len: Int): List[Int] = {
if (len == 0) {
list
} else {
list match {
case n :: n_1 :: _ => recFib(n + n_1 :: list, len -1)
case _ => recFib(1 :: list, len -1)
}
}
@lhoang
lhoang / roman.scala
Created April 29, 2019 15:34
Roman Numbers in Scala
def roman(n: Int) = {
def div(v: Int, d: Int) : (Int, Int) = (v / d, v % d)
val romanMap = List(
(1000, "M"),
(900, "CM"),
(500, "D"),
(400, "CD"),
(100, "C"),
(90, "XC"),
(50, "L"),
@lhoang
lhoang / roman.js
Created April 29, 2019 15:34
Roman numbers in JS
const roman = (n) => {
const div = (v, d) => {
return {quotient: v / d, rest: v % d}
};
const romanMap = [
{diviser: 1000, letter: "M"},
{diviser: 900, letter: "CM"},
{diviser: 500, letter: "D"},
{diviser: 400, letter: "CD"},
@lhoang
lhoang / .block
Last active March 24, 2017 13:50
Retournements RER
license: mit
@lhoang
lhoang / README.md
Last active March 13, 2017 23:12
tuto-choroplethe
@lhoang
lhoang / README.md
Last active March 6, 2017 23:12
Tuto Carte France