Apple Contact & Calendar Server - dockerised

         ·

I've been using Radicale as a contacts / calendar server (CardDAV / DalDAV) for some time now, and it worked flawlessly across macOS and Windows Phone for contacts and calendars. However, I recently got an iPhone and synchronising calendars from Radicale just crashed the iPhone calendar app. It worked fine some of the time, but most times it just crashed, which is not great. Therefore, I went on the search for a better self-hosted calendaring server.


Updating a tiny Rails app from Rails 3.1 to Rails 4.2

              · ·

In 2011 I wrote a small Rails app in order to learn Ruby better and see what all the fuss was about – this was Antipodes, a website that shows you the antipodes of a given point or country/state using google maps. I built it using the latest and greatest version of Rails available at the time, which was 3.2. It has since fell to various security issues and has been superseded by newest version, and is currently unsupported.


No Content Found

        

“So, the tests sometimes fail inexplicably” is a sentence you probably hear pretty often if you're running any type of full-stack, browser-driven integration tests over a large-enough code base, especially when customising on top of an existing product. Today's instance was puzzling at first - the tests would sometimes fail to log in at all. That is, open the login page, fill in the username and password, wait until the URL change and assert that we're now on the dashboard - nope, failure.


In Maven, LESS is less

              · ·

Sorry, this is a rant. I was recently investigating Maven plugins for LESS compilation. The use-case is pretty run-of-the-mill (I think?): I want to be able to write a .less file anywhere in my project src/ folder and have Maven compile it to CSS in the corresponding folder in target/ at some point of the build pipeline. I first looked into lesscss-maven-plugin, a short-and-sweet kind of tool that looks perfect if you have one (and only one) target folder for all of your CSS.


Pushing bookmarklets to their limits

        

I recently had to implement a new functionality for an internal web application: a button to download a specially-formatted file. The right way to do it is, of course, to deploy server-side code generating the needed file in the backend and make it accessible to the user via the front-end. The application in question is an important company-wide production system and I was on a hurry, so I decided to go the Quick way rather than the Right way 1.


On overflowing stacks

              ·

I recently set out to implement a few basic data structures in C for the hell of it (and to reassure myself that I can still code C), and ran into an interesting compiler wart… I was trying to instantiate a static array of 10 million integers (who doesn't?), in order to test insertions and deletions in my tree. However, as you can astutely deduce from the title of this post, this was too much for the stack of my poor program and ended up in a segfault - a textbook stack overflow.


Javascript closures as a way to retain state

              ·

Long time no blog! Let's get back into it with a nifty and clean way of retaining state in Javascript - closures. I was recently looking for an easy way to call a specific function after two separate/unrelated AJAX calls to two remote endpoints have been completed. The naive method would be to make the first AJAX call -> callback to the second AJAX call -> callback to doSomething, but we can use the fact that these two AJAX calls are not related and run them concurrently.


Bits of javascript goodness

             

(This blog post is better followed with the associated github repo. Run the Sinatra server with ‘ruby slowserver’, pop up a browser, and follow the revisions to see how the code gradually gets better. :) ) Recently at work, we wanted to modify some js ad code to include weather data for better ad targeting. For certain caching reasons, weather data has to be fetched by an AJAX call, then fed to the ad code.


Format perlcritic output as TAP to integrate with Jenkins

              · ·

Perl::Critic is a nifty syntax analyzer able to parse your Perl code, warn you against common mistakes and hint you towards best practices. It's available either as a Perl module or a standalone shell script (perlcritic). Unfortunately, there is no standard way to integrate it with Jenkins. Jenkins, the continuous-integration-tool-formerly-known-as-Hudson, is the cornerstone of our continuous building process at work. It checks out the latest build from Git, runs a bunch of tests (mainly Selenium, as we develop a website) and keeps track of what goes wrong and what goes right.


Optimising a video editor plugin

              ·

During the past few weeks, I have been writing a C++ plugin to grade C41 digital intermediates in Cinelerra, an open-source Linux video editor. C41 is the most common chemical process for negatives, resulting in films that look like this — you probably know it if you've ever shot film cameras. Of course, after scanning those negatives, you have to process (“grade”) them to turn them back to positive. And it's not as simple as merely inverting the values of each channel for each pixel; C41 has a very pronounced orange shift that you have to take into account.