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
///usr/bin/env jbang "$0" "$@" ; exit $? | |
//JAVA 24 | |
//PREVIEW | |
//DEPS org.neo4j:neo4j-jdbc:6.1.3 | |
import java.sql.DriverManager; | |
import org.neo4j.jdbc.Neo4jPreparedStatement; | |
/** |
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
///usr/bin/env jbang "$0" "$@" ; exit $? | |
//JAVA 23 | |
//PREVIEW | |
//DEPS org.neo4j:neo4j:2025.01.0 | |
//DEPS org.neo4j.procedure:apoc-common:2025.01.0 | |
//DEPS org.neo4j.procedure:apoc-core:2025.01.0 | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.util.Map; |
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
-- Inspired by https://gist.github.com/Bilbottom/e1d3d677d2479e0602132327703ff15d | |
-- Fixed datatypes that don't render in mermaid (structs, decimal etc.) | |
-- Uses 1:n as base, cardinalities are hard to derive | |
-- Looks for column comments | |
-- Avoids regex. | |
COPY ( | |
WITH hlp AS ( | |
SELECT referenced_table, c.table_name, | |
trim(string_agg(d.comment, ' ')) AS comment, |
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
sed '1s/.*= //' tweets.js | | |
duckdb -s " | |
SELECT strptime(t->'tweet'->>'created_at', '%a %b %d %H:%M:%S %z %Y') AS created_at, | |
t->'tweet'->>'full_text' AS text, | |
NULLIF(t->'tweet'->>'in_reply_to_status_id', 'null') IS NOT NULL AS is_reply, | |
t->'tweet'->>'in_reply_to_screen_name' AS in_reply_to_screen_name, | |
(t->'tweet'->>'in_reply_to_user_id_str')::bigint AS in_reply_to_user_id_str, | |
(t->'tweet'->>'in_reply_to_status_id')::bigint AS in_reply_to_status_id | |
FROM read_json('/dev/stdin') t | |
WHERE text NOT LIKE 'RT @' |
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
///usr/bin/env jbang "$0" "$@" ; exit $? | |
//JAVA 17 | |
//DEPS org.neo4j:neo4j:5.24.1 | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.util.ArrayList; | |
import java.util.Map; |
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
select year(strptime("Aktivitätsdatum", '%d.%m.%Y, %H:%M:%S')) as year, round(sum(regexp_extract("Aktivitätsbeschreibung", '(\d+(?:\.\d+)*) new kilometer', 1)::double), 2) as new from 'activities.csv' where "Aktivitätsbeschreibung" like '%new kilometers%' group by all order by year; |
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
///usr/bin/env jbang "$0" "$@" ; exit $? | |
//JAVA 17 | |
//DEPS info.picocli:picocli:4.7.5 | |
//DEPS info.picocli:picocli-codegen:4.7.5 | |
//DEPS org.neo4j:neo4j-cypher-dsl-parser:2023.9.7 | |
//DEPS com.opencsv:opencsv:5.9 | |
import java.io.InputStreamReader; | |
import java.nio.file.Files; | |
import java.nio.file.Path; |
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 demo; | |
import java.util.Map; | |
import java.util.stream.Collectors; | |
import org.neo4j.driver.Driver; | |
public record Movie(String id, String title) { | |
public static final class Repository { |
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
Moved to https://github.com/michael-simons/pv |
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
//usr/bin/env jbang "$0" "$@" ; exit $? | |
//JAVA 17 | |
//DEPS org.neo4j.driver:neo4j-java-driver:5.7.0 | |
//DEPS com.fasterxml.jackson.core:jackson-databind:2.14.1 | |
package ac.simons; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; |
NewerOlder