Skip to content

Instantly share code, notes, and snippets.

Avatar

Christophe Benz cbenz

  • https://jailbreak.paris/
  • Paris, France
View GitHub Profile
@cbenz
cbenz / machine.js
Last active Jan 27, 2021
Generated by XState Viz: https://xstate.js.org/viz
View machine.js
// interface Player {
// name: string
// stack: number
// cards: Array<Card>
// bet: number
// }
const PRE_FLOP = "PRE_FLOP"
const FLOP = "FLOP"
const TURN = "TURN"
@cbenz
cbenz / machine.js
Last active Jan 22, 2021
Generated by XState Viz: https://xstate.js.org/viz
View machine.js
Machine({
id: 'game1',
initial: 'betting',
context: {
betAmount: 0,
counterValue: 0
},
states: {
betting: {
on: {
@cbenz
cbenz / music-chords-charts-in-elm-talk-abstract.md
Last active Feb 22, 2017
Music Chords Charts in Elm - abstract of the talk
View music-chords-charts-in-elm-talk-abstract.md

This talk is about music but is not restricted to musicians!

When playing an instrument in a jam session, musicians sometimes need to see the chords of the tune they are playing. A chords chart is a convenient way to represent a music tune as a table, containing chord names in "Jazz notation", but not music notes. Chords charts are scattered on forums, are static images most of the time, and there are many versions of which some are wrong.

These drawbacks led me to start the Open Chords Charts project. The backend is a centralized and collaborative database of chords charts. The frontend, written in Elm, allows to browse charts, add/edit them, fork other users charts, fix errors and make links between charts. I'll show some features such as changing the key in which the song is displayed – a killer feature for musicians who dislike to do the transformation in their head. The frontend is responsive and offline-first, so that musicians can build a set-list and follow the songs on their mobile phone while play

@cbenz
cbenz / add_cedillas.py
Last active May 11, 2016
Add cedillas to each char of a string
View add_cedillas.py
import unicodedata
def add_cedillas(text, cedilla = '̧'):
return unicodedata.normalize('NFC', ''.join(map(lambda char: char + cedilla, text)))
add_cedillas('tsss')
# => 'ţşşş'
add_cedillas('facile')
# => 'f̧a̧çi̧ļȩ'
@cbenz
cbenz / README.md
Last active Jan 12, 2016
Cantine Mirabeau
View README.md

README is empty

View section_1_traitements_salaires_ppe_pensions_rentes.py
# -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <contact@openfisca.fr>
#
# Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of OpenFisca.