Skip to content

Instantly share code, notes, and snippets.

View yaf's full-sized avatar

Yannick François yaf

View GitHub Profile
let result = 'content, file\n';
const fs = require('node:fs');
// Fichier `support-url-usage-in-pix.json` généré à partir de la command suivant
// `gh search code "support.pix" --repo 1024pix/pix --json "repository,path,textMatches,url" --jq 'map(.textMatches = (.textMatches | map(.fragment)))'`
const fileContent = fs.readFileSync('support-url-usage-in-pix.json', 'utf-8');
const supportUrlUsage = JSON.parse(fileContent);
supportUrlUsage.forEach(function(usageInFile) {
// Faire le compte par « étape » du nombre d'assessmentId par challengId
const fs = require("fs");
const { parse } = require("csv-parse");
@yaf
yaf / rdv-solidarites-github-issues
Created August 20, 2021 14:37
curl github issues
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/betagouv/rdv-solidarites.fr/issues
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/betagouv/rdv-solidarites.fr/issues/1241/events
curl \
@yaf
yaf / tcr
Created November 23, 2020 10:28
(bundle exec rspec spec/services/rdv_updater_spec.rb && git add -A && git commit) || git checkout .
@yaf
yaf / Co-auteur
Created October 15, 2020 20:31
Co-auteur
git commit -t .gitmessage
$ cat .gitmessage
[un sujet qui commence part un verbe au présent]
Co-authored-by: krichtof <christophe.robillard@beta.gouv.fr>
Co-authored-by: yaf <yannick.francois@beta.gouv.fr>
Co-authored-by: pblayo <philippe.blayo@beta.gouv.fr>
Co-authored-by: LucienMLD <lucien.mollard@beta.gouv.fr>
@yaf
yaf / create-user.sh
Last active October 15, 2020 20:07
configuration user postgresql
# Les paquets Debian nécessaire pour faire du postgresql avec Ruby
sudo apt-get -y install postgresql postgresql-contrib libpq-dev
# création d'un compte CSF, avec un mot de passe CSF, pour la base de données :
sudo -u postgres psql -c "create role csf with createdb login password 'csf';"
# pour tester :
psql -U csf -h localhost
# renvoie "database "csf" does not exist"
@yaf
yaf / hello.rb
Last active October 12, 2020 21:40
begin
phrase("Henri")
rescue
puts "erreur, la fonction phrase() n'existe pas encore"
end
require "./une_lib"
puts "Hello depuis le fichier executé : hello.rb"

Keybase proof

I hereby claim:

  • I am yaf on github.
  • I am ya_f (https://keybase.io/ya_f) on keybase.
  • I have a public key ASBAUhe0KEwpEtGUyAXIWqHVnDILFoqdSVCJ0EN5WI5d2go

To claim this, I am signing this object:

@yaf
yaf / jonesforth.f.txt
Last active March 28, 2024 12:08
Jones Forth fantastic simple 4th implementation written from assembly, that is remarkably readable
\ -*- text -*-
\ A sometimes minimal FORTH compiler and tutorial for Linux / i386 systems. -*- asm -*-
\ By Richard W.M. Jones <rich@annexia.org> http://annexia.org/forth
\ This is PUBLIC DOMAIN (see public domain release statement below).
\ $Id: jonesforth.f,v 1.17 2007/10/12 20:07:44 rich Exp $
\
\ The first part of this tutorial is in jonesforth.S. Get if from http://annexia.org/forth
\
\ PUBLIC DOMAIN ----------------------------------------------------------------------
\
@yaf
yaf / binomage-tmux
Created March 29, 2016 14:03
Use to connect to a tmux session named "binomage". Start this session with -L on machine , and add this line in ~/.ssh/authorized_keys file
command="/usr/bin/tmux -L binomage attach",no-port-forwarding,no-X11-forwarding,no-agent-forwarding ssh-rsa