Skip to content

Instantly share code, notes, and snippets.

@romaintailhurat
romaintailhurat / SketchSystems.spec
Created September 12, 2023 08:52
Questionnaires list filtering
Questionnaires list filtering
Empty
type APP-> With input
With input
cancel -> Empty
@romaintailhurat
romaintailhurat / SketchSystems.spec
Last active September 12, 2023 08:53
Questionnaires list filtering
Questionnaires list filtering
Empty
type APP-> With input
With input
cancel -> Empty
@romaintailhurat
romaintailhurat / SketchSystems.spec
Created September 12, 2023 08:45
Questionnaires list filtering
Questionnaires list filtering
Empty
type APP-> With input
With input
cancel -> Empty
@romaintailhurat
romaintailhurat / eno-measure-units.py
Last active June 28, 2022 08:49
Eno XSLT measure units update
"""
Starting with this issue: https://github.com/InseeFr/Pogues/issues/504, we wanted a
better management of the measure unit list used in Pogues / Eno.
This script produces the XSLT fragment in Eno that handles this part of
the Pogues XML to DDI transformation.
The source is: https://github.com/romaintailhurat/DDI-Access-Services/blob/master/src/main/resources/measure-units.json
We go from:
@romaintailhurat
romaintailhurat / stack.js
Last active November 8, 2017 09:01
stack created by romaintailhurat - https://repl.it/Mgsq/2
/*
Stack, array implementation
http://www.cs.usfca.edu/~galles/visualization/StackArray.html
*/
class Stack {
constructor() {
this._stack = [];
this._index = -1;
}
@romaintailhurat
romaintailhurat / queue.js
Created November 8, 2017 09:00
queue created by romaintailhurat - https://repl.it/Mo4a/11
/*
Queue, array implementation
http://www.cs.usfca.edu/~galles/visualization/QueueArray.html
*/
const init = Symbol("init");
class Queue {
constructor() {
this._queue = [];
french_phone_regexp <- "^((\\+)33|0)[1-9](\\d{2}){4}$"
is_valid_phone_number <- function (phone_number) {
# This function takes a phone number and returns TRUE if it is a valid french phone number.
# A number is valid weither it starts with +33 or 0
# Based on this particular regular expression : https://www.regexpal.com/95062
return(grepl(french_phone_regexp, phone_number))
}
@romaintailhurat
romaintailhurat / random-names.js
Created April 17, 2016 09:11
Naming things randomly
const vows = 'aeiouy'.split('');
const cons = 'bcdfghjklmnpqrstvwxz'.split('');
function rand(min, max) {
return Math.floor(Math.random() * (max - min +1)) + min;
}
function randomLetter(group) {
return group[rand(0, group.length - 1)];
}