Rails Friendly URLs Gem

Great! After several months working on this, I have finally released the first stable version of my Rails Friendly URLs gem. This is a very interesting feature that I started developing at OffsideGaming as a feature request for a particular partner and I was surprised to realise that no gems already existed for this! Basically it consists of a gem that allows administrators of any web service to dynamically configure any url they want into a SEO Friendly one and instantly see it applied in its website. Apart from how cool it is to see a url as friendly rather than a machine generated one, it definitely has it’s SEO advantages and therefore I thought It would be a nice contribution to the open source community. It performs three changes for every configured url:

  • Makes the application recognise the new route and act exactly as the originally configured one.
  • Makes the original one to be redirected to the new one, to avoid search engines penalise your site.
  • Makes Rails url and path helpers to use the friendly url, so you don’t need to change any single line of code in order to use them. And all these is done dynamically, without even need to restart your application server!

If you want to know more just visit the Rails Friendly URLs Gem Github Repo where you will find all the source code and instructions to set up and running easily. Also, if you want to see it in action and even play a little bit with it I’ve uploaded an example application in Heroku. The url is this: https://rails-friendly-urls-test.herokuapp.com/

I’ll be more than happy of hearing from you if you ever use it, or even if you find any issue using it. Leave your comments below!


Rails Push Notifications Gem

For the last months I’ve come across several backend ruby developments that required, at least, one common thing. Mobile devices push notifications.

Although it’s true that you can find several open source gems out there, I found none fully featured, bug free and suitable for both iOS and Android so I thought that could be a very good contribution for the community and, after some time working on it and testing it here is the result.

The Rails Push Notifications Gem is an intuitive and easy to use gem that will allow you to integrate both iOS and Android push notifications into your rails project.

Rails Push Notifications Gem supports:

  • Multiple iOS and Android applications/configurations
  • Ad-hoc and bulk notifications
  • Fully customisable notification’s contents
  • Apple’s both sandbox and production environments
  • Apple’s feedback service

At the moment of sending the notification(s) you’ll have feedback information available on whether the push was successful or failed.

At the moment, I’m using it successfully in two live products and having a great experience.

Visit the GitHub repository at: https://github.com/calonso/rails-push-notifications for detailed installation instructions and a step by step usage example and, please, feel free to leave a comment here if you need help or just to tell us about your experience using it!




Enumerados (Numbered) is, by far, the largest project that we faced at Unkasoft. It is a multiplayer board game which goal is to build simple (+ and -) arithmetical operations by crossing your given chips with the ones that are already on the board (like Scrabble but with numbers).

From the technical point of view it involved three different developments: a backend and two native (iOS and Android) frontends. Particularly I have fully developed the backend where I were almost fully dedicated during the last two years. Lots of iterations, changes, migrations and new features were required to get the final 3.7.1 version.

The backend is fully built using Ruby on Rails, starting at version 3.1 and finishing at 3.2.13. All the infrastructure was held at Heroku where it was using 4 web dynos as average, one single worker dyno and another plugins such as AdeptScale, PGBackups, Scheduler, New Relic, Blitz, RedisToGo and a Crane PostgreSQL Database.

The communication with mobile clients is done through a HTTP REST JSON API and, due to the required evolution on the whole project, the server ended up serving 3 different API versions concurrently.

By far, the most interesting and time consuming part of the development has been the optimisation, at all levels:

  • Database: Mainly using New Relic and Posgres ‘explain analyze‘ command I designed structure modifications, queries optimisations, PL/pgSQL procedures, etc…
  • Application: Again New Relic had a key role in helping spotting the worst performing transactions and bottlenecks along with profiling and benchmarking tests execution in my local development machine and also using Heroku Blitz add-on for load testing. At this level I implemented asynchronous query handling, background pre calculations, cache-based (sync and async) solutions where possible and some algorithms and data structures optimisation. Also improved database usage.
  • API and communication with mobile frontends: At this point, using users feedback and data provided by Google Analytics and New Relic native mobiles plugin we improved the communication layer by modifying (merging/splitting) queries, background preloading some other queries, etc…

Another thing that I am very proud of is the result of the push notifications feature evolution. At the very beginning I started using two different rails gems, one for Apple and for Google integration the other. I decided to go for third party open source gems mainly because I guessed that it would take me longer to develop, test and stabilise a new one from scratch. But after a while using them I started finding bugs and missing features that were important for us, so I began developing a new Rails Push Notifications Gem from scratch that, after some time I open sourced at my Github profile.

Going back to the game itself, here you can find the download links:

Also, here you can see some screenshots on the game.