Posts Tagged ‘Rails’

ESI & Mongrel-ESI.. Request for Feedback

.thumbnail { padding:12px; float:right}

The Railsconf08 talk on ESI & Rails has sparked some interest in the community, and Todd, the core mongrel-esi maintainer, is asking for feedback on the mongrel-esi mailing list.
The latest rumor is he is working on a nginx port of mongrel-esi, which I have to [...]

Advanced Rails Recipes

.thumbnail { background:transparent url(http://www.pragprog.com/images/books/190×228/book-shadow.png) no-repeat scroll left top;
padding:7px; float:left}

Congratulations to Mike Clark and the Pragmatic Programmers team for shipping Advanced Rails Recipes. I highly recommend [...]

ActsAsInsertOrUpdate

Problem

With high volume Rails applications, entities with unique constraints are expensive and error prone to create/update. ActsAsInsertOrUpdate helps solve that problem (if you’re using MySQL), by leveraging the “INSERT … ON DUPLICATE KEY UPDATE” functionality.

Scenario
Lets say you have a Person, and Entity, and a Rating. Each user can rate each entity only once, and [...]

Agressive Timeouts On External API Calls

One of the challenges with writing a Facebook or Bebo application is staying within a limit it gives you to respond with data before it shows the Application Did Not Respond page to a user. Having a content reach application calling external APIs, like Amazon or YouTube, with response times beyond your control, forces you [...]

Leverage Rails Resource Routes on Facebook

Since all canvas page views are proxied through POSTs, resource routes were hopelessly broken. The Facebook platform team was kind enough to add a new feature just for us rails folks: a new signed parameter that indicates the original request type (i.e. POST v. GET) against canvas pages.

Here’s a small patch you can stick at [...]

Super fast IP to lat/lng in Rails

In building the eye candy demo for the Graphing Social conference, I needed a quick way to geo-locate users by IP address. For Rails, GeoKit is an awesome plugin. It supports a list of providers, and overlays distance calculations, before_filter helpers, all sorts of good stuff.
It uses hostip.info to do IP to lat/lng, using [...]