Skip to content

Instantly share code, notes, and snippets.

View michael-simons's full-sized avatar
πŸ‘‹

Michael Simons michael-simons

πŸ‘‹
View GitHub Profile
Warning: Please re-evaluate whether any experimental option is required, and either remove or unlock it. The build output lists all active experimental options, including where they come from and possible alternatives. If you think an experimental option should be considered as stable, please file an issue.
========================================================================================================================
GraalVM Native Image: Generating 'native-tests' (executable)...
========================================================================================================================
[1/8] Initializing... (9,9s @ 0,41GB)
Java version: 25.0.2+10, vendor version: GraalVM CE 25.0.2+10.1
Graal compiler: optimization level: 2, target machine: armv8.1-a
C compiler: cc (apple, arm64, 21.0.0)
Garbage collector: Serial GC (max heap size: 80% of RAM)
2 user-specific feature(s):
@michael-simons
michael-simons / checkstyle.xml
Created September 14, 2022 08:49
Checkstyle config enforcing tabs but allowing leading spaces in text blocks.
<?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+.*""";'/>
@michael-simons
michael-simons / Server.java
Created October 12, 2020 09:38 — forked from nigjo/Server.java
A simple, insecure One-File-Java-Server to serve static pages. Main purpose is to have a simple server to locally test some github pages.
/*
* 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

Listened often section rank grouping

Exported on 12.1.2026 at 12:41:17 MEZ from Cursor (2.3.34)


User

In the artist view change the "listened often to in" section in such a way that when a rank occurs multiple times, the months in which that rank occured are listed in the same bullet point.


<?xml version="1.0"?>
<ivysettings>
<settings defaultResolver="downloadGrapes"/>
<caches lockStrategy="artifact-lock-nio"/>
<resolvers>
<chain name="downloadGrapes" returnFirst="true">
<filesystem name="cachedGrapes">
<ivy pattern="${user.home}/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml"/>
<artifact pattern="${user.home}/.groovy/grapes/[organisation]/[module]/[type]s/[artifact]-[revision](-[classifier]).[ext]"/>
</filesystem>
boot_version dependency size version
3.3.5 HdrHistogram 177206 2.2.2
3.3.5 HikariCP 161840 5.1.0
3.3.5 LatencyUtils 29779 2.0.3
3.3.5 activemq-broker 1238079 6.1.3
3.3.5 activemq-client 1487443 6.1.3
3.3.5 activemq-jms-pool 55481 6.1.3
3.3.5 activemq-mqtt 104072 6.1.3
3.3.5 activemq-openwire-legacy 693329 6.1.3
3.3.5 activemq-pool 21686 6.1.3
@michael-simons
michael-simons / GoLEmbedded.java
Created October 15, 2025 08:27
Game of Life with Neo4j embedded.
///usr/bin/env jbang "$0" "$@" ; exit $?
//JAVA 25
//RUNTIME_OPTIONS --enable-native-access=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
//DEPS org.neo4j:neo4j:2025.09.0
import org.neo4j.dbms.api.DatabaseManagementServiceBuilder;
void main() throws IOException, InterruptedException {
var height = 30;
var width = 30;
@michael-simons
michael-simons / copy_to_mermaid.sql
Created November 21, 2024 11:21
Quickly create Mermaid ER-Diagrams for DuckDB Tables
-- 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,
import module java.sql;
import module org.neo4j.jdbc;
// java --enable-preview --module-path neo4j-jdbc-full-bundle-6.7.0.jar --add-modules org.neo4j.jdbc Demo1.java
void main() throws SQLException {
try (
var connection = DriverManager.getConnection("jdbc:neo4j://localhost:7687/movies?enableSQLTranslation=true", "neo4j", "verysecret");
var stmt = connection.prepareStatement("""
INSERT INTO Movie (title, released) VALUES (?, ?)
@michael-simons
michael-simons / Polyline.java
Last active April 13, 2025 15:36
If you ever want to encode a poly line against Google Earth / OSM Valhalla standards
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Gatherers;
public final class Polyline {
private final List<Point> points = new ArrayList<>();
private final int scale;