Skip to content

Instantly share code, notes, and snippets.

View helpermethod's full-sized avatar
⌨️
hacking

Oliver Weiler helpermethod

⌨️
hacking
View GitHub Profile
@helpermethod
helpermethod / json-schema.java
Created September 2, 2019 15:29
JSON Serializer which infers schema
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.node.ArrayNode;
import org.apache.kafka.common.errors.SerializationException;
import org.apache.kafka.common.serialization.Serializer;
import org.apache.kafka.connect.data.Timestamp;
import java.lang.reflect.Field;
@helpermethod
helpermethod / grit.md
Last active September 16, 2019 07:01
grit - a modern jgit wrapper

grit.commit(g -> g .message("") .author() );

@helpermethod
helpermethod / kick-ass-cd.md
Last active July 25, 2019 13:12
Kick ass CD with Maven CI friendly versions and GitLab CI

Maven CI friendly versions

Speed up initial checkouts with shallow cloning

❓ Does GitLabCI skip shallow clones on merge requests?

variables:
  DEPTH: 1
@helpermethod
helpermethod / assorted-scripts.md
Last active June 9, 2019 14:08
Assorted Bash scripts
# kill all processes listening on port 2181
lsof -i :2181 | tail  -n+2 | awk '{ print $2 }' | xargs kill -9
@helpermethod
helpermethod / gitlab-mr-cl.md
Last active January 10, 2019 16:22
Open a new GitLab Merge Request from the command line

Add the following shell function to your .bashrc.

mr() {
  local url=$(git remote get-url origin)

  # on OSes other than Mac OS X replace `open -a "Google Chrome` with your browsers executable, e.g. google-chrome on Ubuntu
  open -a "Google Chrome" "${url%.git}/merge_requests/new?merge_request[source_branch]=$(git symbolic-ref -q --short HEAD)"
}
@helpermethod
helpermethod / gradle.sh
Last active November 21, 2018 17:15
Working transparently with Gradle and the Gradle Wrapper
gradle() {
[[ -f gradlew ]] && ./gradlew "$@" || command gradle "$@"
}
@helpermethod
helpermethod / comm.md
Created August 20, 2018 13:03
comm command
comm -23 <(sort other-ids) <(sort obsolete-ids)