Skip to content

Instantly share code, notes, and snippets.

@dfrommi
dfrommi / .Jooq-Codegen with Flyway and Testcontainers in Gradle.adoc
Last active September 14, 2023 20:50
Jooq-Codegen with Flyway and Testcontainers in Gradle

Jooq-Codegen with Flyway and Testcontainers in Gradle

At the time of writing, the Gradle-Jooq-Plugin doesn’t offer a good way to use Testcontainers for generation. The fundamental issue is, that the JDBC-URL - or more specifically the port - can’t be read from TestContainers unless it’s started. Thus it can’t be used in the Plugin-configuration and setting it later is hardly possible.

So this example uses the plain Jooq-Generator classes.

@dfrommi
dfrommi / .Resilient RabbitMQ-Listener with Spring.adoc
Last active June 20, 2023 22:20
Resilience4j Event-Handler to start/stop RabbitMQ-Listeners

Resilient RabbitMQ-Listener with Spring

In case of high error rates during message processing, it might be beneficial to stop message-consumption for some time. This does not only reduce the number of errors in the system, but also allows other consumers to process the message successfully.

Circuit-breakers are made for detecting high error rates and stop/restart the processing.

There is no prepared integration between RabbitMQ-Listeners and Circuit-Breakers, but the gap can be easiliy filled with a Resilience4j event-handler starting and stopping RabbitMQ-listener.

@dfrommi
dfrommi / .Writing AsciiDoc in GitHub.adoc
Last active June 5, 2022 21:13
Common Asciidoc-setting for Gist adocs
@dfrommi
dfrommi / Use IntelliJ IDEA as mergetool in git.adoc
Last active June 5, 2022 20:54
Use IntelliJ IDEA as Mergetool in Git

Use IntelliJ IDEA as Mergetool in Git

IntellJ IDEA contains a very good merge UI, ideal to resolve conflict during merge or rebase. The functionality is accessible also from command line, without having a project with the conflicting sources. Integration into the git commandline flow is quite easy, as git already has the concept of diff- and mergetools.

Migrating an RDS DB instance to an Aurora DB cluster with CloudFormation

There are several guides describing how to migrate a plain RDS instance to an Aurora cluster using read replica. But none of them describes how the new Aurora cluster can afterwards be maintained further with CloudFormation.

This guide describes a migration path I've used on production services. A few manual steps and a short downtime - or at least read-only mode - are required, but the final cluster will then be part of an already existing CloudFormation stack.

High-Level Process

With or without CloudFormation, the high-level steps are the following

@dfrommi
dfrommi / .Calculation of Dew-point and Absolute Humidity.md
Last active October 18, 2020 12:48
Calculation of Dew-point and Absolute Humidity #util

Calculation of Dew-point and Absolute Humidity

Dew-Point and absolute humidity can be calculated from temperature in celsius and relative humidity.

The Barometer class expects both values as inputs and calculates absolute humidity af and dew-point td.

@dfrommi
dfrommi / .Homebrew Bundle in a Nutshell.md
Created October 18, 2020 12:10
Homebrew Bundle in a Nutshell #tools

Homebrew Bundle in a Nutshell

Bundle is a tap (aka extension) to run several Homebrew commands in one go. The list of commands is read from a plain-text Brewfile.

It has support for

  • taps
  • packages
  • casks
  • Mac App Store
@dfrommi
dfrommi / .Patch binary files with Java.md
Last active October 18, 2020 12:15
Patch binary files with Java #java #util

Patch binary files with Java

Recently, I wanted to create an "intelligent" binary patcher, which not only replaces some chunk of binary data at a file's predefined offset, but instead performs search and replace. BinaryPatcher.java is the result.

The usage is pretty straight forward. Let's have a look at an basic example:

@dfrommi
dfrommi / .Modular Fish-Shell Configuration.md
Last active October 18, 2020 12:19
Modular Fish-Shell Configuration #fish #config

Modular Fish-Shell Configuration

Fish shell configuration is split into functions, completions and initalization code. But it's easy to split it further on a per feature basis.

The default fish configuration structure looks something like this:

~/.config/fish/
  - functions/
  - completions/