This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.demo.movies; | |
import reactor.core.publisher.Flux; | |
import reactor.core.publisher.Mono; | |
import java.time.Duration; | |
import java.time.LocalDateTime; | |
import java.util.concurrent.atomic.AtomicReference; | |
import org.springframework.data.domain.Sort; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE CONSTRAINT ON (n:Region) ASSERT n.id IS UNIQUE; | |
LOAD CSV WITH HEADERS FROM 'https://raw.githubusercontent.com/gvenzl/sample-data/master/countries-cities-currencies/regions.csv' AS row | |
MERGE (r:Region {id: row['REGION_ID'], name: row['NAME']}) | |
RETURN count(r); | |
CREATE CONSTRAINT ON (n:Country) ASSERT n.id IS UNIQUE; | |
LOAD CSV WITH HEADERS FROM 'https://raw.githubusercontent.com/gvenzl/sample-data/master/countries-cities-currencies/countries.csv' AS row | |
MATCH (r:Region {id: row['REGION_ID']}) | |
MERGE (c:Country {id: row['COUNTRY_ID']}) ON CREATE | |
SET c.officialName = row['OFFICIAL_NAME'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with recursive factorial (n, factorial) AS ( | |
SELECT 1, 1 | |
UNION ALL | |
SELECT n + 1, ( n + 1 ) * factorial | |
FROM factorial | |
WHERE n <= 10 | |
) | |
select * from factorial; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.jupiter.api.AfterAll; | |
import org.junit.jupiter.api.BeforeAll; | |
import org.junit.jupiter.api.Test; | |
import org.neo4j.driver.AuthTokens; | |
import org.neo4j.driver.GraphDatabase; | |
import org.testcontainers.containers.Neo4jContainer; | |
/** | |
* Creates everything from the test itself. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.eclipse.jetty.http.HttpHeader; | |
import org.eclipse.jetty.http.HttpParser; | |
import org.eclipse.jetty.server.Server; | |
import org.eclipse.jetty.servlet.ServletContextHandler; | |
import java.net.URI; | |
import java.net.http.HttpClient; | |
import java.net.http.HttpRequest; | |
import java.net.http.HttpResponse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2020 Jens "Nigjo" Hofschröer. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String... a) throws Exception { | |
var driver = GraphDatabase.driver( | |
"bolt://localhost:7687", | |
AuthTokens.basic("neo4j", "secret"), | |
Config.builder().withLogging(Logging.console(Level.INFO)).build() | |
); | |
System.out.println("\nImperative transaction functions\n---"); | |
Function<Record, String> getNameFromRecord = record -> record.get("name").asString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git filter-repo --force \ | |
--message-callback ' | |
import re | |
return re.sub(rb"GH-\d+ - ", b"", message) | |
' \ | |
--path .editorconfig \ | |
--path .gitignore \ | |
--path .mvn \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
until (exec 3<>/dev/tcp/127.0.0.1/7687) &>/dev/null; do | |
echo "Try again" | |
sleep 1s | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ac.simons.neo4j.examples; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.util.List; | |
import java.util.Map; | |
import org.neo4j.configuration.connectors.BoltConnector; | |
import org.neo4j.configuration.helpers.SocketAddress; | |
import org.neo4j.dbms.api.DatabaseManagementServiceBuilder; |