Skip to content

Instantly share code, notes, and snippets.

Florent Biville fbiville

Block or report user

Report or block fbiville

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
fbiville /
Last active Dec 19, 2019
Wait for Spring Boot's health status to be up
set -Eeuo pipefail
get_health_status() {
curl --request GET http://localhost:8080/actuator/health 2> /dev/null | jq --raw-output '.status'
main() {
while [ "$(get_health_status)" != "UP" ]; do
fbiville /
Last active Sep 25, 2019
HTTP/2 vulnerabilities and Node / Java libs
fbiville / ResultExtensionTest.kt
Last active Mar 1, 2019
kotlin.Result - flatMap extension
View ResultExtensionTest.kt
import net.jqwik.api.ForAll
import net.jqwik.api.Property
// requires compiler option '-Xallow-result-return-type'
fun <T, U> Result<T>.flatMap(function: (T) -> Result<U>): Result<U> {
return if (isSuccess) {
} else {
fbiville / gist:3041a07f8e83f3925815c74a68184143
Created Nov 27, 2018
Hands on Neo4j - Devoxx Morocco 2018 - solutions
View gist:3041a07f8e83f3925815c74a68184143
"instructions": "Find the number of movies",
"solution": "MATCH (m: Movie) RETURN COUNT(m);"
"instructions": "Find the number of action movies",
"solution": "MATCH (m: Movie {genre: 'Action'}) RETURN COUNT(m);"
fbiville / prepend_test.go
Last active Oct 5, 2018
Golang property-based testing example
View prepend_test.go
package main
import (
func TestSlicePrepend(t *testing.T) {
f := func(head string, tail []string) bool {
result := prepend(head, tail)
fbiville /
Created Sep 4, 2018
Zsh custom config in workstation-setup
echo "Configuring zsh"
brew install grc
brew install coreutils
brew install watch
brew install z
touch ~/.z
brew install zsh zsh-completions
sh -c "$(curl -fsSL"
cp files/dircolors.ansi-dark ~/.dircolors
fbiville /
Last active Oct 5, 2019
Dynamic WireMock port in Spring Boot test
import org.assertj.core.util.Maps;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.MapPropertySource;
import java.util.Map;
import static org.springframework.util.SocketUtils.findAvailableTcpPort;
public class CustomContextInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
View stack.trace
2018-01-02 13:29:13
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.151-b12 mixed mode):
"Attach Listener" #151 daemon prio=9 os_prio=0 tid=0x00007f6b89288800 nid=0x219a waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"BuilderThread 3" #76 prio=5 os_prio=0 tid=0x00007f6b89285800 nid=0x1bac waiting on condition [0x00007f6b6eb34000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000807ff168> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
fbiville /
Created Aug 27, 2017
Neo4J embedded database JUnit rule that works consistenly against all Neo4j 3.x stable versions
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Transaction;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.function.BiFunction;
fbiville /
Last active Nov 26, 2016
Dr Who dataset for Neo4j 3.x

Initial Doctor Who dataset

This is based on the data published by Neo Technology.

The main difference lies in the introduction of labels and the export in Cypher rather than the raw Neo4j files. This offers a greater interoperability (the raw files do not work on Neo4j 3.x instances).

The dataset is in dr-who.cypher.

Import with neo4j-shell

You can’t perform that action at this time.