See our books for programmers (Rails, React.js, blogging, remote)

Rafał Łasocha

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.

continue reading →

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 from git repo (which had, like I said, outdated configuration) to the machine and run nixos-rebuild --switch which essentialy made system into unbootable state because of wrong UUIDs in /etc/fstab.

continue reading →

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 these containers with NixOS and we are by far happy with this solution.

However in this post I would like to describe how to package a simple ruby program, based on simple password manager CLI utility - pws. I’ve chose such a simple program to reduce the scope of this post - I hope that in future I’ll be able to describe more complicated cases.

continue reading →

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 before. We’ve decided that the simplest solution would be to load all data in the beginning and display an animation when it’s loading.

In the future when necessity to hit refresh each time we want fresh data would become troublesome we could simply add Pusher-like solution to update data in real-time.

In this post I want to present you solution how our implementation looked like. In our application we are using ES6 (using Babel) and alt.js as a library delivering Flux features.

continue reading →

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 We have already installed Chillout gem in other project I work at.

continue reading →