Internationalization in Flutter 1.22+

Earlier I wrote about Flutter's new internationalization support, then still in beta.
Now in Flutter 1.22 this feature went stable and it's even better than it was during the beta!

Using Webpack with Django: no plugins required!

This post explores setting up Webpack in a Django project with minimal friction. The defacto solution for this, django-webpack-loader, is too heavy handed in my opinion. This post aims to provide a guide to setup Webpack in Django, without any plugins and using both Webpack's and Django's strengths.

Kubernetes workshop in a box

We recently organised an internal Kubernetes workshop at our office. Each participant got their own 3-node Kubernetes cluster and all they needed was a computer with an SSH client, no other software required! How? Read on to find out!

Localizing your app with Flutter's new gen_l10n tool

I'm recently getting into Flutter so I'm still figuring out some common practises. I was surprised to find that the recommended approach for internationalization was quite cumbersome and laborious.

Fortunately, the Flutter team is working on a simplified i18n process that can already be used today and in this post I'll show you how!

Extending Flutter Driver with custom commands

Flutter Driver is a library to write end-to-end integration tests for Flutter apps. It’s similar to Selenium WebDriver (for web apps), Espresso (for native Android apps) and Earl Grey (for native iOS apps). It works by instrumenting the Flutter app, deploying it on a real device or emulator and then ‘driving’ the application using a suite of Dart tests.

In this post we'll look at how Flutter Driver communicates with your app and how we can extend that communication with custom commands.

Generating CSS from scratch with PostCSS

For a soon-to-be open-sourced project I had to generate a CSS stylesheet based on user input.

Initially I started out with good ‘ol string templating and interpolation but it soon became pretty complex, as I needed to conditionally add certain properties and declarations.

It occurred to me that what I wanted was a representation of the CSS structure in code, an Abstract Syntax Tree (AST). That would allow me to build up the CSS tree structure in code and turn it into a string later on.

I decided to see if I could use PostCSS, since I figured it must be turning CSS into an AST already.

HTTP caching gotcha: Heuristic Freshness

I recently ran into an issue where after deployment of an SPA (Single Page Application), a situation would occur where the page looked broken because CSS could not be loaded.

During analysis of the issue I ran into a thing I had never heard of: Heuristic Freshness.

k3s HTTPS with Let’s Encrypt

K3s is a Certified Kubernetes distribution designed for production workloads in unattended, resource-constrained, remote locations or inside IoT appliances. It provides a ready to go Kubernetes instance packaged as a single binary.

This guide will show you how to easily set up k3s with HTTPS via Let’s Encrypt.

Caveats storing large amounts of data in Elixir Agents

Recently while working on an Elixir project I ran into an interesting gotcha with Agents that caused massive amounts of resource usage. Read on to find out what happened.

Quick tip: treat warnings as errors in ReasonML

I've been playing with Reason a lot lately as I'm building an open source personal note taking app. One thing I like to do in my projects is be strict about warnings by treating them as errors, so I wanted to do this in Reason as well.

I couldn't find exactly how to do this in the docs, so I started looking at some OCaml resources and stumbled upon this chapter of the Real World OCaml book where it was mentioned in passing that @A can be used to enable all warnings.

Putting it all together, for Reason this means putting the following in your bsconfig.json:

{
...
"bsc-flags": ["-warn-error", "@A"]
...
}

This worked, but also suddenly enabled warnings that were not enabled before and looked pretty harmless. Fortunately, it's possible to disable warnings on a per warning basis like so:

{
...
"bsc-flags": ["-warn-error", "@A", "-w", "@A-9-40-41-42-102"]
...
}

These numbers like 9, 40 and so forth refer to specific compiler warnings documented here. The Bucklescript compiler also outputs these numbers as warnings are generated so it's easy to figure out which ones you want to put in there.

🌶 Spice up your server rendered apps with Stimulus and Turbolinks

These days, SPA’s (Single Page Applications) are an undeniable trend on the web. However, there are still use-cases where a 'traditional' server rendered application makes a lot of sense.

In this post I take a brief look at using Stimulus and Turbolinks to improve the user experience of such apps by sprinkling some interactive Javascript features on them, while keeping your sanity.

Dashbling - hackable React-based dashboarding

At work, we've been using Dashing for years for internal dashboards that are displayed throughout the office. I've always loved Dashing because it provides just simple building blocks that allow you to do anything. The process of getting information on a dashboard is as simple as:

  1. Write some data fetching logic in Ruby, schedule it to run every X minutes.
  2. Write some HTML, CSS and Javascript to make it visible.

It's just code. As a developer, I love this. Many dashboarding tools out there exist that allow you to drag and drop widgets on page and connect it to 'data sources', but truth is data comes from many different places that all have their unique APIs etc. Being able to write some simple code and have all the flexibility that comes with that is very powerful.

One problem that Dashing has is that it has began to show it's age. Especially it's frontend, written with Batman.JS and Coffeescript is no longer on par with modern development stacks like React with ES2015+ and tools like Webpack.

This is exactly where Dashbling, my new open source project, comes in.

Inlining stylesheets in Middleman 4

If you want to squeeze out that last bit of performance on your site like me you might consider inlining your stylesheets into the HTML. This saves a roundtrip to the server and can increase render performance. Now this definitely doesn't make sense in all cases but for sites with tiny stylesheets like mine it's a nice win to speed up (first) render.

Building GitHub Pull Requests using Jenkins Pipelines

I've written about building Github Pull Requests with Jenkins back in 2013. Three years later we're still strong Jenkins users here at Kabisa, even though Jenkins changed quite a bit. Most notably Jenkins introduced the notion of Pipelines.

Jenkins Pipelines allow you to describe your entire CI/CD pipeline in code and version it together with your production code. Additionally the whole Jenkins Pipelines ecosystem allows for many powerful setups, including building jobs in Docker containers and built-in support for building Github Pull Requests.

In this post I'm going to show you how to configure Jenkins 2.0 with Pipelines to setup a complete CI/CD pipeline with builds running in Docker containers for isolation and ease of environment setup.

Deploy a Spring Boot app on your own server in less than 15 minutes

Hosted PaaS (Platform As A Service) offerings like Heroku and OpenShift are great but not always suitable or even possible to use. If you need or want full control over your data and servers, or you just want to host your latest side project but don’t want Heroku dyno sleeping you might just want to self host.

Traditionally self-hosting was painful and cumbersome but today there are plenty options to self-host your apps that are nearly as painless as a hosted PaaS solution. In this tutorial I will show you how to deploy an app on Dokku.

Jenkins + Docker = awesome CI

I’ve written about Continuous Integration at Kabisa before. Recently we’ve upgraded our CI environment to be even more awesome. Here’s how.

Building GitHub Pull Requests with Jenkins

At Kabisa we're pretty heavy Jenkins users. We live and breathe Test Driven Development, so a CI server continuously running our tests and building our apps is vital.

About a year ago we switched some projects over to Travis CI, because it had such awesome Github pull request integration. Nowadays it’s possible to make Jenkins build your GitHub pull requests as well, let me show you how.

Jekyll + indextank = static websites with fulltext search

For a while I have been wanting to write a Jekyll plugin to automatically index all pages on IndexTank. I was reminded to this by the introduction of Tapir and decided to finally go ahead and create the plugin.

I'm about to graduate for my Software Engineering Bachelor and will be starting as a Ruby and IOS developer at Kabisa soon. I haven't done much Ruby work yet (I used to be more of a Python guy), so this was an excellent chance for me to practice my Ruby skills a bit.

Airplayer status

Recent developments have made possible what a lot of people have been waiting for: AirPlay music streaming to non-Apple (licensed) hardware. A lot of people have asked me since if I could include this in Airplayer. While this is certainly possible, I've decided not to do that. Here's why.

Airplayer

Recently, I've been working on Airplayer, a Python script to make media playing software Apple Airplay compatible. It currently supports XBMC, Plex and Boxee, but could support any media playing software through the 'pluggable backends' feature.

Selecting the outbound ip address in Linux

Recently, I wanted to assign a second public IP address to a Linux (Debian) server. First thing that came to mind was to create a network interface alias like so:

/etc/network/interfaces

iface eth0 inet dhcp

iface eth0:0 inet static
address x.x.x.x (the secondary IP)
gateway x.x.x.x (the secondary IP gateway)
netmask x.x.x.x (the secondary IP netmask)

Creating a network interface alias makes sense because both my IP addresses are in the same subnet. Doing this worked, but it also posed a problem. I had to be able to specifiy which of my IP addresses was used for outbound connections. Here's how.

Moving to Hyde

For the last few years my website has been running on a custom made PHP (eew) 'blog engine'. Nowadays I prefer to code my websites using Python and Django.

However, Django is quite memory intensive (for my 128MB RAM vps server that is) and it's way to advanced for a simple blog and some static pages anyway. So I decided to take a different road.

Colored UIProgressView

A little while ago, I found myself in the position of needing a UIProgressView in a color different then the default blue. I was suprised to find out that the UIProgressView class does not support setting a tintcolor. So I decided to subclass UIProgressView and draw my own ProgressView with support for setting a tintcolor.

The result became 'PDColoredProgressView'.