View format_java.java
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 com.google.googlejavaformat:google-java-format:1.15.0 | |
//RUNTIME_OPTIONS --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED | |
//RUNTIME_OPTIONS --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED | |
//RUNTIME_OPTIONS --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED | |
//RUNTIME_OPTIONS --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED | |
//RUNTIME_OPTIONS --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED | |
import com.google.googlejavaformat.java.Main; |
View Neo4jAndJDK17Records.java
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
//JAVA 17 | |
///usr/bin/env jbang "$0" "$@" ; exit $? | |
//DEPS org.neo4j.driver:neo4j-java-driver:5.2.0 | |
import java.util.List; | |
import org.neo4j.driver.AuthTokens; | |
import org.neo4j.driver.GraphDatabase; | |
// You need to import the Neo4j record, otherwise you will have ambiguous imports | |
import org.neo4j.driver.Record; |
View twitter_archive_fun.sh
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
# Most interactions / mentions, excluding myself. | |
{ sed -e '1s/.*/[/' -e '$d' tweets.js && sed '1s/.*/,/' tweets-part1.js; } | \ | |
jq ' | |
[.[].tweet.entities.user_mentions[] | select(.screen_name != "rotnroll666") | {handle: .screen_name}] | | |
group_by(.handle) | map(.[0] + {"count": length}) | | |
sort_by(-.count,.handle|=ascii_downcase) | limit(20;.[]) | | |
"@\(.handle) (\(.count))" | |
' |
View checkstyle.xml
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
<?xml version="1.0"?> | |
<!DOCTYPE module PUBLIC | |
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" | |
"https://checkstyle.org/dtds/configuration_1_3.dtd"> | |
<module name="Checker"> | |
<module name="SuppressWithPlainTextCommentFilter"> | |
<property name="offCommentFormat" value='=\s+"""'/> | |
<property name="onCommentFormat" value='^\s+.*""";'/> |
View format_cypher.java
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.6.3 | |
//DEPS org.neo4j:neo4j-cypher-dsl-parser:2022.4.0 | |
import picocli.CommandLine; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; |
View RenderMonths.java
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.6.3 | |
package df; | |
import picocli.CommandLine; | |
import picocli.CommandLine.Model.CommandSpec; | |
import picocli.CommandLine.Option; | |
import picocli.CommandLine.ParameterException; | |
import picocli.CommandLine.Spec; |
View foo.sql
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 duplicate_checksums AS ( | |
SELECT MD5 FROM file_duplicates_develop.files | |
GROUP BY MD5 HAVING COUNT(*) > 1 | |
) | |
SELECT * FROM file_duplicates_develop.files | |
WHERE MD5 = duplicate_checksums.MD5 | |
ORDER BY -Size, MD5; |
View README.md
The goal was it to find the authors of a book in fileA.json and get their details in fileB.json
See:
https://twitter.com/JMHReif/status/1503851216740171784?s=20&t=4D2LUKLH9Kh5hCuTSxRlbw
https://twitter.com/JMHReif/status/1503851872096067585?s=20&t=4D2LUKLH9Kh5hCuTSxRlbw
Goal: Create an array of author ids from fileA. Depending on what is to be filtered from fileA.json, there are different approaches:
NewerOlder