NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
This file contains hidden or 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
| -- A method for storing and retrieving hierarchical data in sqlite3 | |
| -- by using a trigger and a temporary table. | |
| -- I needed this but had trouble finding information on it. | |
| -- This is for sqlite3, it mostly won't work on anything else, however | |
| -- most databases have better ways to do this anyway. | |
| PRAGMA recursive_triggers = TRUE; -- This is not possible before 3.6.18 | |
| -- When creating the Node table either use a primary key or some other |
This file contains hidden or 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.Arrays; | |
| import org.apache.commons.cli.CommandLine; | |
| import org.apache.commons.cli.CommandLineParser; | |
| import org.apache.commons.cli.DefaultParser; | |
| import org.apache.commons.cli.HelpFormatter; | |
| import org.apache.commons.cli.Option; | |
| import org.apache.commons.cli.Options; | |
| import org.apache.commons.cli.ParseException; | |
| public class Application { |
This file contains hidden or 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
| (function(XHR) { | |
| "use strict"; | |
| var stats = []; | |
| var timeoutId = null; | |
| var open = XHR.prototype.open; | |
| var send = XHR.prototype.send; | |
This file contains hidden or 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
| /* | |
| Step 1 | |
| Create NorthWindContacts database in SSMS | |
| Step 2 | |
| Copy this script into SSMS, select NorthWindContacts | |
| Step 3 | |
| Run the script |
This file contains hidden or 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.amazonaws.regions.Regions; | |
| import com.amazonaws.services.s3.AmazonS3; | |
| import com.amazonaws.services.s3.AmazonS3ClientBuilder; | |
| import com.amazonaws.services.s3.internal.Constants; | |
| import com.amazonaws.services.s3.model.*; | |
| import lombok.extern.log4j.Log4j2; | |
| import java.io.ByteArrayInputStream; | |
| import java.io.ByteArrayOutputStream; | |
| import java.io.InputStream; |
(Steps taken from: https://www.baeldung.com/x-509-authentication-in-spring-security)
All passwords: changeit
openssl req -x509 -sha256 -days 3650 -newkey rsa:4096 -keyout rootCA.key -out rootCA.crt
This is a short and simple example on how to build a proper Keycloak cluster, using JDBC_PING as discovery protocol and an NGINX server as reverse proxy.
Please see also my video about Keycloak Clustering: http://www.youtube.com/watch?v=P96VQkBBNxU
This file contains hidden or 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
| using Microsoft.EntityFrameworkCore.Migrations.Operations; | |
| namespace Gist.Extensions.Sql | |
| { | |
| internal sealed class CreateTableIfNotExistsOperation : CreateTableOperation | |
| { | |
| } | |
| } |
