1. Customizing Circe's auto generic derivation

    While modeling the domain I often use sealed trait hierarchies, value classes, and case classes. They are essential for idiomatic Scala code. However, the encoding and decoding them to JSON can be problematic. Even though Circe provides boilerplate-free generic derivation, the JSON encoded using the default configuration may be confusing. In this post, I describe how to make it more friendly.

    circe, configuration, json, scala, shapeless, typelevel

  2. Parallel futures and exceptions

    Asynchronous applications are much harder to debug. You do not get the whole stack trace so easily. So it is important to react to all the exceptions that might unexpectedly occur. I found a case when following a simple pattern to run futures in parallel leads to loss of exceptions. In this post I describe a solution for that.

    applicative, exception, future, scala

  3. How to make a docker machine from an old laptop

    On OS X you can not run Docker natively. Instead, you must use a virtual machine. It is common to run out of memory if you run multiple virtualized docker containers, IDEs, Chrome tabs and so. Although it is possible to use cloud instance as docker machine the high latency is an issue. An alternative for that is to run Docker Machine on a spare laptop in a local network. In this post I briefly describe how I did it.

    docker, generic, laptop, machine, osx, ubuntu

  4. Getting started with emacs for scala programming

    This month I switched to emacs for scala programming. I was tired of the IntelliJ IDEA slowness and the fact that it consumes lots of CPU and memory. It works great for java, but with scala it’s unpleasant. Then I discovered spacemacs and ensime. I felt a relief. I find it much more ergonomic and faster IDE for scala. However, the beginnings are hard. I wrote this post to help you with the firsts steps in emacs.

    emacs, ensime, evil, osx, scala, spacemacs, vim

  5. For-comprehensions with Combined Monads

    The code should be easy to read. One of the programming principles to make the code more readable is to avoid nested operations. The so-called pyramid of doom does not only refers to callback hell in javascript but ofter appear in scala as well. Here, I describe how to make the for-comprehensions more elegant when using combined monads in scala.

    either, for-comprehension, future, http4s, monad transformers, option, scala, scalaz

  6. Apps that increase productivity

    This month I started working remotely. It turns out that it is harder to stay focused and productive that way. However, I managed to gather and integrate apps that help me to increase productivity and avoid distractions. In this post, I describe what I am using and why.

    f.lux, ifttt, pomello, pomodoro, productivity, stayfocusd, todo

  7. 32 things to do before deploying to production

    Following the recent trend of “10 Things You Need To…” articles I decided to write my own list of things that you need to do. Nah. I have just built the list based on my experience and mistakes that I do not want to repeat. This is my checklist for future production deployments.

    checklist, deployment, devops, monitoring, production

  8. Streaming of data using http4s and scalaz-stream

    Http4s and scalaz-stream are good alternatives for akka-http and akka-stream. In this post, I show how easy it is to stream data over HTTP using them. Streaming allows to operate on heavy data without the necessity to store it in the memory. With http4s, it is just a few lines of code.

    http4s, idiomatic, non-blocking, scala, scalaz-stream

  9. Terminal multiplexer with status line

    Recently I started using tmux and powerline again. I needed a way to split terminal windows into panes and monitor cpu, memory and network at the same time. Here I show how to install it.

    console, multiplexer, powerline, shell, status line, terminal, tmux, zsh

  10. Building Docker images using Chef

    Chef is a great configuration management tool. It allows managing environments, supports multiple platforms, handles updates, but takes a lot of time to deploy software from scratch. Chef is not like Docker, which allows spinning up containers in seconds. If you are already using Chef, then you might not have time to rewrite all the Cookbooks into Dockerfiles. In this post, I’m showing how to build Docker images quickly using existing Chef Cookbooks.

    automation, chef, container, cookbook, deployment, docker, kitchen