• 7 ways to improve your next support rotation with event storage

    In every software company, part of engineering responsibilities is to help the Support Team resolve customer issues and maintain the stability of the application by responding to errors and alerts. In this article, I want to briefly describe the benefits for engineers working on support issues of having an application...

  • Always set explicit timeouts

    Our next ticket is to implement another integration with 3rd party HTTP API. As it’s in life, the documentation is imprecise, provided examples are outdated, and nobody is responding to our e-mails. It’s not the first one though, so after some time we do have it ready. Either it is...

  • Limit your automatic retries

    Recently I’ve seen such code: def build_state(event) # ... rescue RubyEventStore::WrongExpectedEventVersion retry end As you can see, the build_state may raise an RubyEventStore::WrongExpectedVersion which, if raised, is always automatically retried. This error is raised if there are two concurrent writes to the same stream in RubyEventStore but only one of...

  • Heuristics for choosing bounded context for an event handler

    Some time ago I was implementing a feature. As part of this I was, of course, writing a bunch of event handlers. At some point, I’ve realized I didn’t put much thought when choosing the bounded context to which the event handlers should belong. It was mostly driven by intuition...

  • Using streams to build read models

    Building read models sometimes pose a technical challenge, especially if given infrastructure doesn’t provide order guarantee and the model has to be eventually consistent. Read models are considered the easy part, so we would like to be able to implement them quickly and move to the more interesting tasks. One...

  • Optimizing test suites when using Rails Event Store

    Using domain events in DDD make it easier to tackle complex workflows. If we are working in a monolith infrastructure, it may cause our event store to have thousands handlers and running all of them in test environment is short way for long test suites. However, there’s a trick which...

  • Patterns for asynchronous read models in infrastructure without order guarantee

    When we focus on the model in CQRS architecture, we put most effort into write model. Not only this is the place where the business operations are implemented and breakthroughs in understanding domain are happening – we also consider it the part of the implementation where we should put a...

  • Removing magic with magic

    Some gems, like InheritedResources, help us by reducing the lines of code we have to write by providing definitions automatically. However, depending on how the gem is written, it can be done “magically”. In some cases, we want to remove such gems. By “magic” I obviously mean defining methods, or...

  • Testing cookies in rails

    Recently at Arkency I was working on a task, on which it was very important to ensure that the right cookies are saved with the specific expiration time. Obiovusly I wanted to test this code to prevent regressions in the future. Controller tests Firstly I thought about controller tests, but...

  • Recovering unbootable NixOS instance using Hetzner rescue mode

    Some time ago we had a small fuckup with one of our CI build machines. One of the devs was changing sizes of the file system partitions and he forgot to commit new NixOS configuration to the git repository where we synchronize it. After some time, I’ve uploaded NixOS config...

  • Packaging ruby programs in NixOS

    Recently at Arkency we’re exploring how NixOS could fit our infrastructure. From a few weeks we’ve switched most of our projects CI systems from CircleCI to Buildkite. Buildkite offers unique offer in which it is us who provide infrastructure and containers to test our applications so we’ve decided to setup...

  • Circle CI configuration with yesod (haskell) backend and javascript frontend

    For “Daj się poznać” contest I’ve decided to make a tool which is close to pinboard and pinterest, but with features I was missing. When I’ve chosen frameworks which I’ll gonna use, and both of them came with some default tests, I’ve decided to setup continuous integration using CircleCI. This...

  • Vagrant: An unexpected error occurred while loading the vagrant-login plugin. Please contact support with the following error code: '7'.

    TL;DR If you’ve encountered this error in Vagrant, reinstall all your plugins. Today after updating my Arch Linux (which I wasn’t doing for a long time) I had a problem with vagrant. After trying to vagrant up my machine I got following output: An unexpected error occurred while loading the...

  • Loading all data when starting flux SPA

    Recently we’ve been working on an application which is a typical SPA which uses the Flux approach. After some time we had a problem that besides our frontend being SPA, each time we clicked on link leading to some “page”, we’re loading data again, even if this data was loaded...

  • Change terminal colorscheme depending on hour of a day

    One of my colleagues some time ago stated a problem - can we automatically change colorscheme of the terminal based on whether it’s day or night? It should solve a problem that we don’t like to look at white background in the middle of the night or dark background when...

  • Introducing Read Models in your legacy application

    Recently on our blog you could read many posts about Event Sourcing. There’re a lot of new concepts around it - event, event handlers, read models… In his recent blogpost Tomek said that you can introduct these concepts into your app gradually. Now I’ll show you how to start using...

  • Tracking down unused templates

    Few days ago, my colleague raised #sci-fi idea. Maybe we could somehow track templates rendered in application to track down which ones aren’t used? Maybe we could have metrics how often they’re used? Metrics? That sounds like gathering data using Chillout.io. We have already installed Chillout gem in other project...

  • Decimals, rails, and "," as a decimal separator

    This will be completely technical post. I want just to leave somewhere a solution for a problem which I had to solve some time ago. I hope that there is some gem to do that. But the only one I found, which could fit my needs, is Delocalize, but it...

  • (PL) Postgres - konfiguracja na linuksie

    Problem Jeśli chcesz skonfigurować pod swój użytek postgresql, ale występuje u Ciebie błąd: FATAL: role "xxx" does not exist lub FATAL: password authentication failed for user "postgres" to przeczytaj dalej - jest wyjaśnienie, jak skonfigurować użytkownika postgres. Zakładam, że Twój system to linuks - rozwiązanie testowane na Ubuntu 12.04 i...

  • (PL) Nowy laptop

    Już od kilku miesięcy (konkretnie, od połowy maja), jestem posiadaczem nowego laptopa, Asus X53SV (i7-2670QM, 8GB RAM, Nvidia GT540M, SSD Corsair Force 4 64GB). Poprzedni aż prosił się o wymianę - HP Compaq 6720s (Core Duo, 2GB RAM, HDD 160GB). Porównując? Niebo a ziemia. Hałas, temperatura Laptop jest praktycznie bezgłośny....

  • (PL) Dwa spotkania NaZGULa za nami

    Nazgul? Pomysł NaZGULa, czyli Nieformalnej Zamojskiej Grupy Użytkowników Linuksa pojawił się jeszcze w roku szkolnym, elwin wpadł na pomysł, żeby coś takiego zorganizować, kupił domeny, chwilę porozmawialiśmy i w gruncie rzeczy rozeszło się po kościach. A właściwie doszliśmy do tego, że najlepiej te spotkania zrobić na wakacjach, po maturze. Po...

  • (PL) Koniec matur

    W końcu koniec matur. 3 lata nauki w liceum, przygotowań do tego ‘egzaminu dojrzałości’, a napisałem tak sobie. Ale w gruncie rzeczy, nie narzekam. Podstawowe matury były łatwe, co jest raczej oczywiste. Ustne tak samo, chociaż z angielskiego dostałem tylko 26 punktów, więc nie jestem zadowolony, ale 20 z polskiego...

  • (PL) Hello world!

    Kolejny pierwszy z kolei post. Może tym razem się uda : ) Blog rusza na jekyllu, jeszcze nie do końca pięknie skonfigurowanym, ale póki co - działa!