has_many :codes

Posts - Page 2 of 6

MySQL dynamic column name

  • 3 min read

This post describes how to dynamically generate column names from row values in MySQL databases, also known as pivot tables. Let’s say you have a table or the results of a query with some values by date in different rows…

Read More

I’m back!

  • 3 min read

Well, it’s been a while since I’ve last updated this blog and I just wanted to make a short little post here to update y’all on a few things. It seems it’s not just me – the blog thing is kinda dying…

Read More

Downtime and DDoS against PowerDNS.net

  • 1 min read

This site is back to normal now, after problems caused by a DDoS were resolved earlier today. The attack was not against the site/server directly, but against the DNS service I’ve used until this morning, PowerDNS.net…

Read More

Backups with duplicity and xtrabackup

  • 5 min read

Here’s how to perform backups with duplicity and xtrabackup with some scripts I wrote and which you can find on Github at . xtrabackup Xtrabackup is a great tool for taking MySQL hot backups (both full and incremental) of…

Read More

Nginx rate limits for third party services

  • 2 min read

API rate limits: the problem In order to prevent abuse many APIs limit the number of requests that a client can make in a given amount of time, through rate limiting practices; here I’ll show you how it is possible to…

Read More

Jenkins with Rails applications

  • 6 min read

I’ve had to set up Jenkins with Rails projects today so I thought I’d write a post about it. Hopefully it will save someone time – I’ll assume here that your already know what Jenkins and CI are, and prefer setting up…

Read More

Devise and default scope for authentication

  • 5 min read

Multi tenancy with default scope Multi tenancy in a Rails application can be achieved in various ways, but my favourite one is using Devise and default scope for authentication as it’s easy and provides good security…

Read More

Top level methods in Ruby

  • 3 min read

How top level methods work in Ruby There are many quirks in the Ruby language which IMO show funny behaviours. Take the top level methods, for example – that is, methods defined outside of a class or module. There is something…

Read More

Microsoft buys a chunk of Nokia. Surprise!

  • 1 min read

We saw this coming, didn’t we? It was all planned, and well orchestrated; it’s been a good strategy: send someone to the other company, help it sink, then buy it at a discount price. It was all a con. I love conspiracies. The…

Read More

Why I switched from Jekyll back to WordPress

  • 5 min read

Back in 2011 I wrote a couple of posts -which became very popular- on why I had migrated from WordPress to Jekyll and on how to perform such migration in great detail; now I will explain why I switched from Jekyll back to…

Read More