Skip to content

Instantly share code, notes, and snippets.

View Maurice-Betzel's full-sized avatar

Maurice Betzel Maurice-Betzel

View GitHub Profile
@Maurice-Betzel
Maurice-Betzel / DatabaseTestModule.java
Created October 12, 2021 17:19 — forked from jwgmeligmeyling/DatabaseTestModule.java
Persisting recursive relationships with Hibernate
package org.hibernate.test;
import com.google.inject.AbstractModule;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.inject.persist.PersistService;
import com.google.inject.persist.jpa.JpaPersistModule;
public class DatabaseTestModule extends AbstractModule {
@Maurice-Betzel
Maurice-Betzel / gist:40ae823c72951e8b5e55ff801dc43f9b
Created December 1, 2022 19:15
Programmatic keyfile creation and PEM file import
/**
* Create a KeyStore from standard PEM file
*
* @param privateKeyPem the private key PEM file
* @param certificatePem the certificate(s) PEM file
* @param the password to set to protect the private key
*/
public static KeyStore createKeyStore(File privateKeyPem, File certificatePem, final String password)
throws Exception, KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException {
final X509Certificate[] cert = createCertificates(certificatePem);
@Maurice-Betzel
Maurice-Betzel / PlutoExplorerExtended.java
Created October 15, 2024 18:49 — forked from DanskerDave/PlutoExplorerExtended.java
PlutoExplorerExtended : a take on the well known PlutoExplorer ("Zoomable and Pannable JavaFX ImageView Example")
package dk.danskerdave.javafx.image;
import java.util.stream.IntStream;
import javafx.application.Application;
import javafx.beans.property.*;
import javafx.geometry.*;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.scene.control.Alert.AlertType;