Skip to content

Instantly share code, notes, and snippets.

View fteychene's full-sized avatar

Francois Teychene fteychene

View GitHub Profile

Bowling Rules

The game consists of 10 frames.
In each frame the player has two rolls to knock down 10 pins.
The score for the frame is the total number of pins knocked down, plus bonuses for strikes and spares.

A spare is when the player knocks down all 10 pins in two rolls.
The bonus for that frame is the number of pins knocked down by the next roll.

A strike is when the player knocks down all 10 pins on his first roll.

Keybase proof

I hereby claim:

  • I am fteychene on github.
  • I am fteychene (https://keybase.io/fteychene) on keybase.
  • I have a public key ASBN34zfHMRt8MGbJiGbgEgnsvgys9UFVaJRi89tf9YYmgo

To claim this, I am signing this object:

@fteychene
fteychene / build.gradle.kts
Last active July 29, 2020 06:42
Hexagonal architecture as polymorphic monad stack in Kotlin with Arrow
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.3.21"
kotlin("kapt") version "1.3.21"
}
repositories {
mavenCentral()
}
@fteychene
fteychene / build.gradle.kts
Last active April 2, 2019 15:45
Polymorphic monad stack test with Arrow
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.3.21"
kotlin("kapt") version "1.3.21"
}
repositories {
mavenCentral()
}
@fteychene
fteychene / curry.kt
Created April 2, 2019 08:30
Kotlin currified
fun <P1, P2, R> ((P1, P2) -> R).curried(): (P1) -> (P2) -> R = { p1: P1 -> { p2: P2 -> this(p1, p2) } }
fun <P1, P2, P3, R> ((P1, P2, P3) -> R).curried(): (P1) -> (P2) -> (P3) -> R = { p1: P1 -> { p2: P2 -> { p3: P3 -> this(p1, p2, p3) } } }
fun <P1, P2, P3, P4, R> ((P1, P2, P3, P4) -> R).curried(): (P1) -> (P2) -> (P3) -> (P4) -> R = { p1: P1 -> { p2: P2 -> { p3: P3 -> { p4: P4 -> this(p1, p2, p3, p4) } } } }
fun <P1, P2, P3, P4, P5, R> ((P1, P2, P3, P4, P5) -> R).curried(): (P1) -> (P2) -> (P3) -> (P4) -> (P5) -> R = { p1: P1 -> { p2: P2 -> { p3: P3 -> { p4: P4 -> { p5: P5 -> this(p1, p2, p3, p4, p5) } } } } }
fun test(val1: Int, val2: String, val3: Float, val4: Double): String = "$val1, $val2, $val3, $val4"
@fteychene
fteychene / script.sh
Created May 16, 2017 15:33
Docker commands
docker network create petclinic-db
docker run -d --net=petclinic-db --network-alias=mysql -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=test mysql:5.5
docker build -t spring-petclinic:latest
docker run -p 8080:8080 --net=petclinic-db spring-petclinic:latest
for i in {1..5}; do; docker run --net=petclinic-db --network-alias=petclinic -d spring-petclinic:latest; done;
@fteychene
fteychene / Requests.java
Created March 14, 2017 21:41
Solution Cours 1 ORM EPSI B3
package fr.ccavalier.hibernate.course.requests;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by charlotte on 20/02/17.
@fteychene
fteychene / delete_agent.sh
Created August 10, 2016 18:24
Delete rancher agent
docker rm -fv rancher-agent rancher-agent-state
rm -Rf /var/lib/rancher/state
@fteychene
fteychene / TennisGame1.java
Created March 29, 2016 14:00
Tennis refactor proposal
public class TennisGame1 implements TennisGame {
private int scoreP1 = 0;
private int scoreP2 = 0;
private String player1Name = "player1";
private String player2Name = "player2";
public TennisGame1(String player1Name, String player2Name) {
this.player1Name = player1Name;
this.player2Name = player2Name;
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear