Skip to content

Instantly share code, notes, and snippets.

@udebella
udebella / grid.txt
Created September 18, 2022 20:10
sudoku
[
[_,_,_, _,5,4, 3,_,1],
[2,_,_, _,_,_, _,_,9],
[3,5,_, _,2,_, _,_,_],
[_,_,_, _,_,7, _,9,4],
[_,_,_, _,_,_, 1,_,_],
[7,_,5, _,6,_, _,_,_],
[_,_,_, _,_,_, _,_,_],
@udebella
udebella / Pull.java
Last active September 13, 2022 10:35
Decorator exploration (Grand Laboratoire 2022)
package decorator;
public class Pull implements Tenue {
private Tenue tenue;
public Pull(Tenue tenue) {
this.tenue = tenue;
}
@Override
public int temperature() {
return tenue.temperature() * 2;
@udebella
udebella / killer-features-tdd.md
Last active July 19, 2022 21:58
Liste des killer features de TDD

Killer features de TDD

Notes brutes de la session du 12/07/2022 au meetup software crafter

Liste des killer features

  • Pairing
    Facile d'organiser une session de pairing avec la technique du Ping-Pong
    Permet un meilleur équilibrage du partage de clavier
@udebella
udebella / reactivity.js
Created October 1, 2021 17:58
Reactivity
const globalEffects = [];
const createHandler = () => {
const effects = {};
return {
get: (target, prop) => {
effects[prop] = [...globalEffects, ...(effects[prop] ?? [])];
return target[prop];
},
set: (object, prop, value) => {
object[prop] = value;
@udebella
udebella / change.js
Last active May 20, 2021 15:06
AzureDevops global change pull request
// You need to load the whole pull request because of the lazy loading feature of azureDevops
// To use it :
// * copy the code inside a browser bookmark with 'javascript:' at the begining.
// * Then click the bookmark when you are on the pull request page of AzureDevops
// It displays the global diff alongside the number of changed files
var changes = ['added', 'removed']
.map(type => `.repos-compare-${type}-lines`)
.map(css => document.querySelectorAll(css))
.flatMap(nodes => Array.from(nodes))
.map(e => e.textContent)

Appeler le 1023
Courrier papier de resiliation en recommandé avec accusé de reception

nom prenom
numero ligne
numero contrat

raison
signature

@udebella
udebella / binary-text-conversion.js
Created June 16, 2019 13:37
Binary text conversion javascript
const binaryToText = binary => binary.split(' ')
.map(str => Number.parseInt(str, 2))
.map(num => String.fromCharCode(num))
.reduce((acc, next) => acc + next, "")
const textToBinary = text => text.split("")
.map(char => char.codePointAt(0))
.map(num => num.toString(2))
.reduce((acc, next) => `${acc} ${next}`)
@udebella
udebella / promises.js
Created March 19, 2018 19:38
Mini-error
// Mini error found in code from https://www.youtube.com/watch?v=ho5PnBOoacw
// You can copy-paste in your browser's f12 (I used var so that you can tweak it directly :))
var waitForEach = (fun, [head, ...tail]) =>
!head ?
Promise.resolve() :
fun(head).then(waitForEach(fun, tail)) // <= ERROR here : it should be fun(head).then(() => waitForEach(fun, tail))
var log = (data) => {
const promise = new Promise((resolve) => {
@udebella
udebella / how-to-choose-a-library.md
Created March 16, 2018 23:50
How to choose a library ?

List of point to pay attention :

Completion

Description

In this item, you look for completion of the tool : if it is outdated/abandonned, actively maintained or feature complete. Obviously, you should avoid outdated/abandonned tools. If you choose an actively maintained, you have to keep in mind that you'll probably need to upgrade on releases (so you should be careful about semver practices of the maintainer).

Popularity

@udebella
udebella / JacksonDeserializer.java
Last active January 5, 2018 23:41
Jackson + Immutable Objects + Builder pattern
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import java.io.IOException;
public class JacksonDeserializer {
public static void main(String[] args) throws IOException {
String json = "{\"field\": \"value\"}";