Open Source Consultant, Software Developer and System Administrator

If you are interrested in hiring a consultant for the effective use of open source software on an enterprise grade, take a look around in the About section to see, what I have to offer.

Blog and snippets

Various snippets or code parts I found useful, so I keep them here for reference.

Updated Vaadin starter to official Spring plugin

Finally came around to update the Spring-Boot Groovy Vaadin Starter to the official Spring plugin. The only major difference now is the handling of the widgetset via annotation instead of configuration.

Also the "close-to-tweetable" example got an update.

// run with `spring run vaadin.groovy`
import com.vaadin.ui.*

class MyUI extends UI {
        protected void init(com.vaadin.server.VaadinRequest request) {
                setContent(new Label("Hello World!"))

Can't leave out variadic args in Java interop with Clojure

When calling interop functions into Java land with Clojure you have pass an empty array. While it's OK in Java/Groovy/... to:


... you have to pass an empty array in Clojure:

(RatpackPac4j/requireAuth SAML2Client (into-array Authorizer []))

Split a sequence by function in Clojure

Split a collection on the sequence of elements, that match it.

(defn split-by
   (comp (drop-while pred)
         (partition-by pred)
         (take-nth 2)))
  ([pred coll]
   (sequence (split-by pred) coll)))
; (split-by zero? [1 0 2 0 3]) => ([1] [2] [3])


While tools like httpie give you a nice way to query web APIs, they only give you the means to query data easily and print the results nicely. Once you need to modify the results or need to drill down on them, you are on your own.

Therefor I wrote my own tool - REST REPL. It starts a Clojure REPL with some state handling (imagine cd from the shell), preloaded libraries, that make your live easier (clj-http, specter,, cheshire) and make it pretty print (with colors) the results using puget.

Since this is a (close to) regular Clojure REPL, you can handle the data as you are used too and you can place reoccurring code into functions.