Skip to content

Instantly share code, notes, and snippets.

Michael Simons michael-simons

Block or report user

Report or block michael-simons

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
michael-simons / log4j2.xml
Created Jun 28, 2019
log4j: Route only subpackage to different appender
View log4j2.xml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" monitorInterval="30">
<Console name="ConsoleAppenderA" target="SYSTEM_OUT" follow="true">
<PatternLayout pattern="mainlog> %m%n%ex"/>
<Console name="ConsoleAppenderB" target="SYSTEM_OUT" follow="true">
<PatternLayout pattern="sublog> %m%n%ex"/>
View WIthInitializer
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@ContextConfiguration(initializers = { BookmarkLoadTest.Initializer.class })
public class BookmarkLoadTest {
private static String clusterUri;
static class Initializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {
public void initialize(ConfigurableApplicationContext configurableApplicationContext) {
View gist:437c17847012e8e1f6ba7c0572346945
Ich guck hier auf den Stack drauf und verstehe ihn nicht:
2019-03-19 14:27:52,947 INFO [io.quarkus] (main) Quarkus 0.11.0 started in 0.036s. Listening on:
2019-03-19 14:27:52,991 INFO [io.quarkus] (main) Installed features: [cdi, resteasy, resteasy-jsonb]
WARNING: The sunec native library, required by the SunEC provider, could not be loaded. This library is usually shipped as part of the JDK and can be found under <JAVA_HOME>/jre/lib/<platform>/ It is loaded at run time via System.loadLibrary("sunec"), the first time services from SunEC are accessed. To use this provider's services the java.library.path system property needs to be set accordingly to point to a location that contains Note that if java.library.path is not set it defaults to the current working directory.
2019-03-19 14:27:55,597 INFO [Driver] (XNIO-1 task-1) Direct driver instance 1633194162 created for server address localhost:7687
2019-03-19 14:27:55,598 WARNING [
// Double-check idiom for lazy initialization of instance fields
private volatile FieldType field;
private FieldType getField() {
FieldType result = field;
if (result == null) { // First check (no locking)
synchronized(this) {
if (field == null) // Second check (with locking)
field = result = computeFieldValue();
View load-connections.cypher
WITH 2407988 as parentRel
MATCH (p:Network {externalId: parentRel})
CALL apoc.load.xml("" + p.externalId + "/full") YIELD value AS v
WITH p, [c IN v._children WHERE c._type = 'relation' AND ANY (t IN c._children WHERE t._type = 'tag' and t.k = 'network' and t.v = 'rcn')] as relations
SET = [r IN relations WHERE = toString(p.externalId) | [t IN r._children WHERE t._type = 'tag' and t.k = 'name' | t.v][0] ][0]
WITH p, relations
UNWIND relations AS relation
WITH p, [t IN relation._children WHERE t._type = 'tag' and t.k ='note' and t.v =~ "\\d+-\\d+"] as connection
WHERE size(connection) = 1
michael-simons /
Created Sep 19, 2018
JDK11 String#isBlank and Predicate.not
import java.util.List;
import java.util.function.Predicate;
public class Test {
public static void main(String...a) {
var strings = List.of("foo", " ", "bar", "", "\t");
var isNotBlank = Predicate.not(String::isBlank);;
michael-simons / META-INF_slash_spring.factories
Created Sep 18, 2018
A quick scribble how to provide defaults for configuration properties in Spring Boot without defaulting. to them in code or condig
View META-INF_slash_spring.factories
michael-simons / Application.kt
Last active Jul 4, 2019
Minimal Kotlin/Gradle Example for Neo4j OGM
View Application.kt
package so
import org.neo4j.ogm.annotation.GeneratedValue
import org.neo4j.ogm.annotation.Id
import org.neo4j.ogm.annotation.NodeEntity
import org.neo4j.ogm.annotation.Relationship
import org.neo4j.ogm.config.Configuration
import org.neo4j.ogm.session.SessionFactory
michael-simons /
Created Aug 28, 2018
Use Spring Data Neo4js injectable OGM Session
package soquestions.transactionandcustomsession;
import java.util.Map;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.session.Session;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
michael-simons /
Created Aug 28, 2018
Enforce a concrete implementation of Pageable for paged Queries with Spring Data (Neo4j)
package soquestions.custompagerequest;
import static*;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.session.Session;
import org.springframework.boot.CommandLineRunner;
You can’t perform that action at this time.