Flex functional testing with FunFx and Cucumber

Cucumber is a great tool I usually use for BDD in my ruby projects, but yesterday I tried it with Flex, and it was very enjoyable. Here a little example on how to test Flex applications with Cucumber.

Hostname middleware for rails apps on multiple servers

If you run a rails application on multiple servers behind a load balancer, almost every time you make a request you have a response from a different host. If you want to know which host has sent back the response, you can use a middleware that adds the hostname in the page title of each request.

Testing rails generators with Cucumber

In the last days I switched a lot of old projects to use Cucumber, then I started writing test for Web App Theme. Here I haven’t models or controllers to test, because it’s just a generator, but I found enjoyable the use of plain text features to describe the ThemeGenerator behavior:

2 minutes admin layout with rails and the web-app-theme generator

Many people found out a rails generator inside my web-app-theme project and asked me how to use it. Here an example, starting from scratch with a new rails app that manages music Albums.

Creating PDF with images using flex and AlivePDF

Today I’m working on an AIR application, and I need to create a PDF starting from a list of images. This PDF needs to have one image for each page. I used AlivePDF, a very useful ActionScript3 library for PDF generation, and I created a simple class that takes an array of image paths and creates the PDF I need.

Cocos2d: how to make a label to fit the Iphone screen width

In the iPhone game I’m working on I need to display a different label every time I start a new game level. Each one of these labels has a random string taken from an array of words, and each one of these strings has different size. So every time I create a new label I set the maximum font size and then I decrement it until the string size measures less than the iPhone screen. I do that using the sizeWithFont method of the NSString class:

Terror the micro aggregator

Terror is a micro feed aggregator made with sinatra and bundled as a gem. It's very simple to use, just install the gem:

gem sources -a http://gems.github.com
sudo gem install gravityblast-terror

Create a new project

terror new_aggregator_name
cd new_aggregator_name 

Start the server

thin start -C config/thin.yml

Run the feeds fetcher

rake feeds:fetch # run it as a cron job

You can browse the source and fork it on github.

Web app theme

A simple theme for web apps. Fork it on github and use it for your cool applications!

Web App Theme

[UPDATE]

Like I wrote in the comments, this layout is inspired from cool applications like lighthouse, basecamp, and others. I love those applications, I love their layouts, and it’s difficult to not be inspired by them.

Radiant Gallery on Dreamhost with Ruby 1.8.7

Some people in the past had problems using the Gallery extension on Dreamhost. I didn’t try Dreamhost but someone from the Radiant list solved that problem following these instructions. Check it out if you are on Dreamhost too.

Radiant iPhone extension 0.0.1

After some works for iPhone I decided to create an extension for Radiant that adds an iPhone tailored ui for the admin panel. It's the first version and for now it just allows to edit existing pages and add new page parts.

You can find more info in the README file on github.

Radiant iPhone extension