Skip to content

Instantly share code, notes, and snippets.

Avatar

François Romain francoisromain

View GitHub Profile
View project-delete.sh
#!/bin/bash
# source: https://gist.github.com/francoisromain/e28069c18ebe8f3244f8e4bf2af6b2cb
# and another script to create the directories deleted by this script
# project-create.sh: https://gist.github.com/francoisromain/58cabf43c2977e48ef0804848dee46c3
# Call this file with `bash ./project-delete.sh project-name`
# - project-name is mandatory
# This will delete 4 directories
View choisir-une-licence.md

TL;DR

  • il est légalement obligatoire à partir du 7 octobre que le code des projets de la fabrique soit open source
  • la politique de contribution DINSIC est dispo.
  • votre projet doit à minima:
  • choisir une license. En prendre une parmi celles dispo sur data.gouv.fr/fr/licences
  • ouvrir son code
  • préciser qui est mainteneur (pour fournir un point de contact)
  • ne pas hésiter à demander des coups de main à la DSI pour tout ce qui est conformité
@francoisromain
francoisromain / project-create.sh
Last active Nov 23, 2021
A bash script to create a Git post-receive hook to deploy after a Git push
View project-create.sh
#!/bin/bash
# source: https://gist.github.com/francoisromain/58cabf43c2977e48ef0804848dee46c3
# and another script to delete the directories created by this script
# project-delete.sh: https://gist.github.com/francoisromain/e28069c18ebe8f3244f8e4bf2af6b2cb
# Call this file with `bash ./project-create.sh project-name`
# - project-name is mandatory
# This will creates 4 directories and a git `post-receive` hook.
View flatten.js
// flatten an array
// input [[[[1], 2, 3], 4, 5, 6, 7], 8, 9, 10, [11, 12, 13]]
// output [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
var flatten = function(e){
var flatArray = [];
if (!Array.isArray(e)) {
flatArray = flatArray.concat(e);
} else {
for (var i = 0; i < e.length; i++) {
View permutations.js
/*
A function that generates every possible sequences of permutations
of elements in a given array.
For example
with a given array ['rock', 'paper', 'scissors']
and a size = 3;
the output should look something like:
[["rock", "rock", "rock"],
["rock", "rock", "paper"],