Skip to content

Instantly share code, notes, and snippets.

View cbenz's full-sized avatar

Christophe Benz cbenz

View GitHub Profile
# -*- coding: utf-8 -*-
# OpenFisca -- A versatile microsimulation software
# By: OpenFisca Team <[email protected]>
#
# Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team
# https://github.com/openfisca
#
# This file is part of OpenFisca.
@cbenz
cbenz / README.md
Last active January 12, 2016 16:00
Cantine Mirabeau

README is empty

@cbenz
cbenz / add_cedillas.py
Last active May 11, 2016 13:04
Add cedillas to each char of a string
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 / esnextbin.md
Last active May 12, 2016 13:11
esnextbin sketch
@cbenz
cbenz / music-chords-charts-in-elm-talk-abstract.md
Last active February 22, 2017 13:48
Music Chords Charts in Elm - abstract of the talk

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 / machine.js
Last active January 22, 2021 23:30
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'game1',
initial: 'betting',
context: {
betAmount: 0,
counterValue: 0
},
states: {
betting: {
on: {
@cbenz
cbenz / machine.js
Last active January 27, 2021 23:56
Generated by XState Viz: https://xstate.js.org/viz
// interface Player {
// name: string
// stack: number
// cards: Array<Card>
// bet: number
// }
const PRE_FLOP = "PRE_FLOP"
const FLOP = "FLOP"
const TURN = "TURN"