Skip to content

Instantly share code, notes, and snippets.

View thomasdarimont's full-sized avatar
🏠
Working from home

Thomas Darimont thomasdarimont

🏠
Working from home
View GitHub Profile
View upgrade_keycloak_database_settings.md

Because of Arjuna timeout / closing the connection after 5 mins, setting following additional JAVA_OPTS might help:

-Dquarkus.transaction-manager.default-transaction-timeout=3600
-Dkeycloak.migration.batch-enabled=true
-Dkeycloak.migration.batch-size=1000
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Acme Mini SPA</title>
<style>
body {
background-color: #eaeaea;
@thomasdarimont
thomasdarimont / index.html
Created November 23, 2023 17:33
Layout with 3 Columns
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Three Column Layout</title>
<style>
.grid-container {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 10px;
}
@thomasdarimont
thomasdarimont / JShellFetchDemo.java
Last active October 10, 2023 23:21
PoC for Fetch API like API for JShell
View JShellFetchDemo.java
package demo;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import java.util.Map;
public class JShellFetchDemo {
@thomasdarimont
thomasdarimont / ExampleResource.java
Last active September 26, 2023 07:09
Example to reproduce RESTEASY-3384 with resteasy-reactive
View ExampleResource.java
package com.example;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
@Path("/hello")
public class ExampleResource {
@POST
public String greet() {
@thomasdarimont
thomasdarimont / minispa.html
Created September 20, 2023 10:23
Example SPA for Keycloak Demo
View minispa.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Acme Mini SPA</title>
<style>
body {
background-color: #eaeaea;
@thomasdarimont
thomasdarimont / Continuation.java
Last active July 20, 2023 00:06
Java21 Continuations Demo
View Continuation.java
package demo.cont;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.util.function.Consumer;
public final class Continuation {
private final Object delegate;
@thomasdarimont
thomasdarimont / MainMethodFinder.java
Last active September 8, 2023 22:28
Small tool to find classes with executable main methods in a given JDK.
View MainMethodFinder.java
import jdk.internal.org.objectweb.asm.*;
import java.io.*;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.*;
import java.util.concurrent.*;
import java.util.function.Consumer;
/**
@thomasdarimont
thomasdarimont / readme.md
Last active July 6, 2023 12:33
Kind with local registry
View readme.md

Create locale registry

create-podman-registry.sh

#!/bin/sh
reg_name='kind-registry'
reg_port='5000'
running="$(podman inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null || true)"
if [ "${running}" != 'true' ]; then
@thomasdarimont
thomasdarimont / readme.md
Created July 6, 2023 11:25
Keycloak Nightly with Podman
View readme.md
podman run -it \
  -p 8080:8080 \
  -p 8443:8443 \
  -p 8787:8787 \
  -e KEYCLOAK_ADMIN=admin \
  -e KEYCLOAK_ADMIN_PASSWORD=admin \
  -e DEBUG=true \
  -e DEBUG_PORT='0.0.0.0:8787' \
 quay.io/keycloak/keycloak:nightly \