docker image inspect IMAGE -f "{{json .Config.Labels}}"
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 java.net.URI; | |
import java.net.URLEncoder; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class LenientUriConverter { | |
final static Pattern URL_PATTERN = Pattern.compile("(.+?://.+?)(/+.*?)?([?#].+)?"); | |
// NOTE: /+ normalizes any double slashes in the path | |
final static Pattern PATHS_PATTERN = Pattern.compile("/+([^/]+)"); |
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 java.time.Duration; | |
/** | |
* Tracks if a given activity has happened more times than the requested threshold | |
* within the requested time window. | |
* | |
* <p> | |
* <b>NOTE</b> this class is <b>not</b> thread-safe. This allows for optimal performance when | |
* concurrent access is not a factor. | |
* </p> |
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 testing; | |
import com.fasterxml.jackson.annotation.JsonProperty; | |
import com.fasterxml.jackson.core.JsonProcessingException; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import org.junit.jupiter.api.Test; | |
import static org.assertj.core.api.Assertions.assertThat; | |
class SerializeEnumTest { |
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
# The following will convert the /data from an existing container named "mc" | |
# into a named volume "mc" and then create a new, re-configured container | |
# named "mc-new". | |
# Keep the old container named "mc" until you have confirmed everything is good | |
# and then you can cleanup using `docker rm mc` | |
docker stop mc | |
docker run --rm --volumes-from mc -v mc:/new alpine cp -avT /data /new | |
docker run -it --name mc-new -v mc:/data -p 25565:25565 -e EULA=TRUE -e MEMORY=2G itzg/minecraft-server |
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
plugins { | |
// https://docs.gradle.org/current/userguide/application_plugin.html | |
id 'application' | |
// https://plugins.gradle.org/plugin/org.openjfx.javafxplugin | |
id 'org.openjfx.javafxplugin' version '0.0.9' | |
} | |
group 'me.itzg' | |
version '1.0-SNAPSHOT' |
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 com.intellij.database.model.DasTable | |
import com.intellij.database.util.Case | |
import com.intellij.database.util.DasUtil | |
/* | |
* Derived from "Generate POJOs.groovy" provided by IntelliJ base install | |
* Available context bindings: | |
* SELECTION Iterable<DasObject> | |
* PROJECT project | |
* FILES files helper |
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 io.smallrye.mutiny.Multi; | |
import java.time.Duration; | |
import java.time.Instant; | |
import javax.enterprise.context.ApplicationScoped; | |
import org.eclipse.microprofile.reactive.messaging.Incoming; | |
import org.eclipse.microprofile.reactive.messaging.Outgoing; | |
@ApplicationScoped | |
public class Chatty { |
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 com.fasterxml.jackson.core.JsonProcessingException; | |
import com.fasterxml.jackson.databind.JsonNode; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import java.util.StringJoiner; | |
class TryReadTreeAndConvert { | |
static class Place { | |
String city; | |
String state; |
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 java.util.List; | |
import java.util.Map; | |
import java.util.Map.Entry; | |
import java.util.TreeMap; | |
import java.util.stream.Collectors; | |
class Scratch { | |
public static void main(String[] args) { | |
final TreeMap<Object, Object> results = List.of( |