Author Archives: nathanvda

[rails] styling on_the_spot with bootstrap v3/v4

The on_the_spot gem allows inline editing of data. In general this is something I prefer over forms: I do not want to switch to a new page to edit something, I want to edit it where I see it (I understand there are some very good cases for the standard show/edit pages). So a very […]

[rails] using font-awesome-5 with turbolinks

If you started using FontAwesome-5 in a Turbolinks project, you will quickly notice the icons disappear after the first page reload. So how can we fix that? I did not immediately find a reference inside the FontAwesome documentation, but luckily google proved helpful and I found this issue Inside the issue I found the fix […]

Alternative RSpec trick for testing methods with arguments

I just read this article titled Useful RSpec trick for testing method with arguments which shows a nifty way to write a repetitive test-suite where you want to verify different arguments give the correct/expected result. The method proposed by the author looks like this: RSpec.describe Daru::Index do let(:index) { [:a, :b, :c, :d] } […]

Render bug with ul in chrome 62?

In our GIS web-application we use leaflet with the superb sidebar-v2 component to have some fold-out pages and command-icons in one place. But we suddenly encountered a bug when users/developers started upgrading to chrome 62. Very weird rendering bug. The icons suddenly were no longer centered inside the lu > li items but only the […]

[rails] improving the performance of a query involving date-ranges

I have an audit-log table with +300M rows and while most messages are just confirming we performed some very repetitive action, I was thinking of an easy way to compress the data: when a month is over, instead of adding 1000 lines per day with the message “CHECKED IT”, replace them with 1 line saying […]

[mac osx] extracting photos from photos library

Before, with iPhotos it was pretty easy to extract files: just drag and drop and they would have the exact same date and time as when they were imported/taken. Now, with the Photos app, this is no longer the case. WTF. A dropped file gets the current date and time. While I can understand why […]

[postgis] BUG: ST_geomfromgeojson rounds z values

… and then I encountered a bug in Postgis 2.0.4. Fuck. ST_geomfromgeojson rounds my z-values to integers, effectively making them useless. I have a little example demonstrating this, and so I imagined to submit a bug. Unfortunately the bug-tracker requires an OS-Geo account, and to get that I need to write an email to get […]

[wice-grid] adding custom filters for a column

Let me quickly introduce WiceGrid, if you do not know yet: it is a super-gem that will allow you to easily show a list/grid of items, and allow easy filtering/searching/pagination. For rails there is, afaik, no better alternative. There are some javascript/jquery driven dynamic grids, but for me the big advantage is that with WiceGrid […]

[rubygems] handling SSL errors on Windows when installing gems

When you encounter SSL errors when installing gems on Windows, the easiest workaround is to change your sources from https://… to http://…. But … I am an avid user/fan of and today I suddenly started getting the error on their domain. So at first I feared that rails-assets had stopped as foreseen (in this […]

Handling deprecated :insert_sql and :conditions for habtm

In a system I am helping to develop a person can be linked to a myriad of things, including themselves, so we use a relation table PersonRelation defined as follows class PersonRelation belongs_to :person belongs_to :personifiable, :polymorphic => true belongs_to :person_relation_type end So a person could be linked to different “personifiable” things, and sometimes the […]