August 27, 2013 § 1 Comment
August 8, 2013 § Leave a comment
Workers are dumb
When doing heavy lifting in a webapp (anything from video transcoding to calling an API), a common practice is to take this heavy lifting out of the request and process it in the background. Doing so means the page can finish loading nice and quickly for the user. A common way to accomplish this is to use a message queue and workers. And workers are dumb.
January 29, 2013 § Leave a comment
Carrying on from my post on the Mint site, I wanted to share a little more information on what I think was the coolest part of my MIDEM Music Hackday hack – the technology.
But first a quick recap of the idea for those in the dark:
To answer the question “what do you listen to?” I created an app that analyses your recent listening history and awards Artist, Genre, Guilty Pleasure and Hipster badges based on certain criteria.
With that out of the way…
October 15, 2012 § Leave a comment
This weekend I decided to have a go at making an app with edge Rails, aka Rails 4.0.0.beta. I hunted around for a summary of the cool new stuff and didn’t really find one. So, here is the interesting things I hit upon, more or less in the order I hit upon them:
October 3, 2012 § 5 Comments
After iOS 6 dropped, we got reports that an iPhone app of ours had stopped working after upgrading. We quickly confirmed that this was indeed the case and started to investigate.
August 21, 2012 § 38 Comments
Consider a fairly normal pattern in a user model in Rails, sending a welcome email when a user signs up. If you’re interested in keeping your controller actions quick whilst you do this, you would probably queue the email to be sent later, like this:
class User < ActiveRecord::Base after_save :queue_welcome_email, :on => :create private def queue_welcome_email Resque.enqueue(WelcomeEmailJob, self.id) end end
class WelcomeEmailJob @queue = :normal def self.perform(user_id) user = User.find(user_id) UserMailer.welcome_email(user).deliver end end
Straightforward, right? You’d think so, but if you implemented this and ran it in a live system, you would find a small number of
ActiveRecord::RecordNotFound errors cropping up in Resque.
July 4, 2012 § 1 Comment
A few months back we looked at issues related to showing custom fonts in firefox (see Cross domain font woes in Firefox). Since then we have also started hosting more and more sites on heroku where you have no control over nginx. Obviously this makes the previously proposed solution hard to implement…plus who can remember all of that config?