Skip to content

Instantly share code, notes, and snippets.

@thieux
thieux / Java8MethodRef
Created June 26, 2016 22:51
Java8 method reference
class Java8MethodRef {
interface Equality1 {
boolean eq(Object a);
}
interface Equality2 {
boolean eq(Object a, Object b);
}
@thieux
thieux / StringTest.java
Created July 12, 2016 23:26
Java String split behavior
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class StringTest {
@Test
public void empty_regex_on_empty_char() {
assertThat("".split("")).isEqualTo(new String[]{""});
}
#!/bin/bash
# Validates utf-8 input
function uu() {
iconv --from-code=utf-8 --to-code=utf-8
}
# Converts UTF-8 -> ISO-8859-1
function ui() {
iconv --from-code=utf-8 --to-code=iso-8859-1
@thieux
thieux / pom.xml
Last active January 28, 2017 20:48
Maven quickstart
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>example-app</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
#!/bin/bash
function uw() {
iconv --from-code=utf8 --to-code=windows-1252
}
function wu() {
iconv --from-code=windows-1252 --to-code=utf8
}

Jeux de caractères : quiz

Connaît-tu l'encodage de tes fichiers sources ?

Tu penses que é es une interjection néerlandaise courante ?

Tu modifies un fichier contenant des erreurs d'encodage ?

Tu ne voit pas le rapport entre un problème d'encodage et une faille de sécurité ?

Everyday Cucumber in IntelliJ

Cucumber runner is used to run the scenario (.feature) from Maven

  1. Write cucumber runner first.
  2. Write scenario in .feature file.
  3. Generate the empty steps.
  4. Glue each step to an actual implementation.

Different step snippet style

Event Storming

Events, commands, aggregates, external systems, key scenarios.

Event

  • Happen in the past
  • Business oriented
  • Start with domain event
  • Assign e.g. orange to events

Domain-driven design

  • Premières réunions avec le métier décourageante
  • On ne sait pas à l'avance où l'exploration mène
  • Utiliser notre capacité linguistique (variation sur les mots et discussions)
  • Utiliser notre capacité à voir dans l'espace (diagramme)

Export

In top.bash

#!/bin/bash

export foo=hello

./sub.bash