Kotlin's context with receivers
Context with receivers is a new experimental Kotlin feature. So let’s explore this feature a bit and see what it is all about.
Context with receivers is a new experimental Kotlin feature. So let’s explore this feature a bit and see what it is all about.
Don’t you just hate it when you’re getting that weird git error that prevents you from pulling to your local branch. For example:
fatal: Need to specify how to reconcile branches.
Well, you could delete your local folder and do a re-checkout.
There are however other ways git can help you, even without falling back to the
method.git reset --hard origin/master
Writing JPQL queries can be annoying, because you cannot test them in a database tool or in your IDE. But with IntelliJ Ultimate, you can!
With Springdoc you can create a Swagger UI and generate the OpenAPI spec file. In a project it is a good practice to support version n - 1 of the API for backwards compatibility. The problem is that some objects have the same name and then the last parsed object is used for all versions in the OpenAPI spec. In this post the solution with definitions is shown.
Do you like stories? Tales that move you out of the ordinary into the extraordinary. Do you take satisfaction in programming? Where every bit, every keystroke means exactly one very thing. Do you esteem transparent functionality above all else? Then read on, to get introduced to a land of farmers, magick and wizards. But its wizards are programmers and its sorcery is called F#…
DevOps is the idea, that the concerns and interests of developers and those of operations are better served when they aren’t addressed in isolation as individual silos, but in unison. As a result, the whole organization that depends on both ends up being more agile and more stable
Coming from a Java background, reflection to me was a useful, albeit highly advanced tool in daily work. Being mostly used in libraries and frameworks, understanding its possibilities and usages was usually enough for me.
While advancing my career and moving to the scala ecosystem I learned about the existence of macros as a kind of compile-time reflection, used mostly by libraries. Still, it being a highly advanced language feature and not very ergonomic for daily programming, I felt more comfortable in the regular code world.
Then, during the development of a certain feature for the client I was working at, I felt the code I had written was so much boilerplate, there should be a way to shorten what I’ve written (unfortunately I cannot remember exactly what that was about, but it definitely had to do with some kind of mapping between data and their corresponding case classes…). In Java I would have tried my hand at reflection to extract and generate POJO’s, which could be done in scala as well, but I’ve always felt reflection isn’t the right tool for custom written production code, it being a slow, purely runtime process, which is never optimized by the compiler. I asked a senior colleague if using a macro to extract the field names and values would be a way to solve this, since it would bring me some compile-time safety. He then introduced me to the shapeless library, and the rabbit-hole opened up.
Getting involved in Open Source software can be fun, as it gives you a glimpse into the future for upcoming versions.
One project I’ve been following over the past couple of years is Cucumber for the Java Virtual Machine.
There’s a noticeable upcoming change that will remove cucumber-java8
,
which will certainly affect users of that dependency.
I’ve made my share of mistakes using Git. This is an easy trick I learned that saved my butt when I would otherwise have lost a bunch of progress after an incorrect Git action.
Preferable you start a ZIO application with just one runtime.unsafeRun
.
But when you’re migrating an old application to ZIO, you likely have multiple places to do runtime.unsafeRun
.
We will investigate how to deal with the environment (layers).