Skip to content

Instantly share code, notes, and snippets.

Avatar

Jan Galinski jangalinski

View GitHub Profile
@jangalinski
jangalinski / mvn-function.sh
Last active May 25, 2021
choose either the mvnw or the global installation
View mvn-function.sh
# dynamically choose mvnw or global.
function mvn() {
# Stop the search on this folder.
# "/" is the highest possible, but you can go for $HOME for example
STOP="/"
# Location of Maven.
# $MVN_HOME/bin/mvn is an option...
MVN_CMD="/usr/local/bin/mvn"
@jangalinski
jangalinski / Foo.kt
Created Feb 11, 2019
kotlin property delegate
View Foo.kt
class Foo {
private var count = 0
private fun count(): Int = ++count
val eager get() = count()
val lazy by lazy { count() }
}
View TaskListenerOnBoundaryEventTest.java
package io.holunda.spike.forum9302;
import org.camunda.bpm.engine.delegate.TaskListener;
import org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration;
import org.camunda.bpm.engine.impl.history.HistoryLevel;
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.camunda.bpm.engine.task.Task;
import org.camunda.bpm.engine.test.ProcessEngineRule;
import org.camunda.bpm.engine.test.mock.MockExpressionManager;
import org.camunda.bpm.extension.mockito.mock.FluentTaskListenerMock;
@jangalinski
jangalinski / EmbeddedInMemoryEventStore.java
Created Aug 28, 2018
Axon InMemory Eventstorage with ability to log the events
View EmbeddedInMemoryEventStore.java
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.axonframework.eventhandling.TrackedEventMessage;
import org.axonframework.eventsourcing.eventstore.EmbeddedEventStore;
import org.axonframework.eventsourcing.eventstore.GlobalSequenceTrackingToken;
import org.axonframework.eventsourcing.eventstore.TrackingToken;
import org.axonframework.eventsourcing.eventstore.inmemory.InMemoryEventStorageEngine;
import java.lang.reflect.Field;
@jangalinski
jangalinski / gradle-kotlin-init
Last active Jul 23, 2018
kotlin-gradle multimodule setup
View gradle-kotlin-init
#!/usr/bin/env bash
app_name=$1
kotlin_version=$2
mdir $app_name
cd $app_name
gradle init --dsl kotlin
View DynamicCallActivityApplication.java
package io.holunda.spike;
import lombok.extern.slf4j.Slf4j;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.camunda.bpm.engine.variable.Variables;
import org.camunda.bpm.model.bpmn.Bpmn;
import org.camunda.bpm.model.bpmn.BpmnModelInstance;
import org.camunda.bpm.spring.boot.starter.annotation.EnableProcessApplication;
View keybase.md

Keybase proof

I hereby claim:

  • I am jangalinski on github.
  • I am jangalinski (https://keybase.io/jangalinski) on keybase.
  • I have a public key ASAR-8W3Zbhg4ENDK-Z5DsVa-4SlsQcCaTvnWJKv4UtKuQo

To claim this, I am signing this object:

View InsertLicense.java
package de.holisticon.bpm.camunda.license;
import org.flywaydb.core.api.MigrationVersion;
import org.flywaydb.core.api.migration.MigrationInfoProvider;
import org.flywaydb.core.api.migration.jdbc.JdbcMigration;
import javax.sql.DataSource;
import java.io.BufferedReader;
import java.io.IOException;
View SpringAopLogging.java
@Aspect
public class LoggingAspect {
private static Logger logger = LoggerFactory.getLogger(LoggingAspect.class);
@Around("requiredLog()")
public Object logMethod(ProceedingJoinPoint proceedingJoinPoint) {
Object returnValue = null;
try {
@jangalinski
jangalinski / BpaClientModelMapperConfigurationIT.java
Created Jul 14, 2016
getting all application context classes
View BpaClientModelMapperConfigurationIT.java
public static List<Object> getInstantiatedSigletons(ApplicationContext ctx) {
List<Object> singletons = new ArrayList<Object>();
String[] all = ctx.getBeanDefinitionNames();
ConfigurableListableBeanFactory clbf = ((AbstractApplicationContext) ctx).getBeanFactory();
for (String name : all) {
Object s = clbf.getSingleton(name);
if (s != null)
singletons.add(s);