A small christmas project, randomly picks a lanuage and database so you know what to use in your next project: WhatLanguageShouldIUse
When using Instant.now(), new Date() or other methods that fetch the current time testing becomes a hassle since you can’t mock static methods easily and therefore can’t test a certain date but only use the current one. A good solution to this problem is using an interface that supplies you with current time and never call these methods directly. This way you can mock the interface in your tests and use a fixed time. I’ll show an example beneath.
Custom annotations on endpoint's methods will let you run code before the endpoint method. This is good for example restricting a user from using a certain endpoint and returning 403 Forbidden before it even gets there like in this tutorial, making the code cleaner and easier to read.
Christmas is around the corner and it is time for some geeky Christmas Crafts! Got an RaspberryPi from a hack night at iZettle and wanted to make something fun out of it, decided on "Git merge activated snowglobe". If the name doesn't say it all, it's an electronic snowglobe that is gonna start "snowing" and playing christmas music each time someone merges a pull request on Github.