Author Archives: Richard

Simplest bit.ly API implementation possible?

To use an URL shortener in your project, I would strongly recommend using bit.ly. It let you set a custom URL (name) and track traffic, clicks and conversations on micro blogs. But best of all, it should be super-fast and super-stable, since Twitter recently chose bit.ly as the shortening service of choice.
Using the bit.ly REST [...]

We are off to @media, London!

Tomorrow, we are off to @media, London.
Hope to see you there! If you see someone looking like us - don’t hesitate to say hello!
We imagine London to be something like this:

Committing to Rails Core

In our last post we talked about upgrading to Rails 2.3, and the issues we encountered. One bug we found was that multiple POST requests issued in a test didn’t reset the post parameters between requests. The patch Peter submitted is now part of the Rails core, and we are very happy about it.
Perhaps not [...]

New rake task for the Tranlsate plugin: Google Translate

We just pushed the latest addition to the Translate plugin which adds a new rake task: “rake translate:google FROM=sv TO=en”. This will translate all keys in sv.yaml using Google Translate into english and store them in en.yaml.
This is a very convinient way of testing your application in a translated state, and look for strings [...]

swedish_pluralize plugin: Swedish pluralization rules for Rails

For those of you looking for Swedish pluralization for Rails, I just refactored this module of ours into a plugin. You can find it on GitHub: http://github.com/newsdesk/swedish_pluralize/tree/master
It’s extracted from the old swe_rails plugin by Ola Bini, which did a bit more than just pluralize in Swedish. So if pluralize is all you want to do, [...]

The “returning” method explained

This one you will find all over the Rails code. The “returning” trick is a really neat way to refactor ugly patterns, such as this one:

object = []
object << “foo” if bar?
object

Into this:

returning [] do |object|
object << “foo” if bar?
end

So what returning does is, it creates an object using the first parameter (a [...]

A short introduction.

Welcome to the blog! I thought it would be appropriate to shortly present Newsdesk in a post before anything else.
If you don’t know about us (and chances are small you do, unless you’re living in Sweden), we are a Swedish equivalent to PRWeb, or PR Newswire in some ways.
We are an online visibility company. Corporations [...]