Articles

You got MIDIator in my Archaeopteryx!

As you are no doubt aware, mad scientist Giles Bowkett’s has a rad drum machine/crazy MIDI thing called Archaeopteryx. A common complaint with Archaeopteryx (hereafter “arkx”) is that it only runs on OSX.

Rockstar Memcaching (video)

InfoQ posted the video to my rockstar memcaching presentation from ruby fringe.

Rockstar Memcaching Video

This should_raise an exception

If you use Shoulda and, like me, you hate Test::Unit’s assert_raise(), I may have something of interest for you.

Why the hate?

Well, assert_raise accepts an *args list of exception types.

If you don’t pass any, you get some nonsense because an empty array doesn’t jive with the exception raised by your block. Useful. So if you don’t care what exception is raised, assert_raise isn’t gonna help you.

Cropping and Pinning Images With CSS

It feels really good to figure out a tricky CSS problem on your own without consulting the
googles. This is a brief story about how I did that very thing while working on the
forthcoming Great Bleything.net Refresh of ‘08™.

As you can see in the image below, the template I’m using wasn’t expecting to have an image
in the left-hand column, so when I put one there, weird stuff happened when the browser was
smaller than about 1100px:

Fixtureless datas with Machinist and Sham

Not long ago Pete Yandell bestowed upon us an alternative to FactoryGirl and other fixture methods: Machinist.

Google Test Automation Conference 08

Yesterday, the third edition of the Google Test Automation Conference finished, and, although my speech was a little disaster, I'm glad. It was a challenge, this was the first time that I gave a speech in english and I chose to do it in front of the main experts in testing in the world.

I'm trying to upload the slides to slideshare but I have several problems converting the file, so, if you want to get them you can download the pdf from my server.

How to call a controller's action from a different controller

We come up with this solution after a couple of failing attempt to find a way to emulate a redirect_to method without actually create a 302 HTTP message which need to be sent to the user and then back to the application.

By using this internal_redirect_to function you will be able to get the same results as a normal redirect_to without send anything to the user, only keep in mind to explicit invoke the return after this function.

Suggestion of Demeter

Frankly, I haven’t ever really made up my mind about how to address the Law of Demeter in Rails. I’d like to use this article as a spring board to discuss the alternatives.

Thinking Sphinx PDF

MySQL (or Postgres) does a fine job when querying specific rows, but it’s not so great when it comes to searching on large text fields. Sphinx is a search service that makes full text searching quite easy and throws in extra features like boolean search (“rails OR merb”), word proximity, and custom filtering.

Thread safety for your Rails

Rails 2.2 marks the first release of thread safe Rails. But “thread safety” alone, without any context, doesn’t mean shit. When people say Rails is “thread safe” ( or otherwise ), they usually refer to the dispatching process of Rails. Before 2.2, Rails dispatching looked like :

Articles | Rails Fire

Articles

Want to create a Sinatra Web Service?

With Sinatra you can quickly create your own tiny web-applications in Ruby and write lots of small services.

Problem definition

To upload a text file to a Sinatra web service and have its sorted content returned.

How to upload a file from the command line?

We shall use cURL, a tool and library designed to give you a user-friendly but low-level interface to making HTTP requests. cURL also supports many other protocols related to uploading and downloading files.

JSONQuerying Your Rails Responses

In which I show how to use a Ruby implementation of JSONQuery to test JSON in Rails apps.

I’m writing an application right now that is really JSON heavy. Some of the functional tests are cucumber and some of them are just rails functional tests using shoulda.

The Animal raises its head

You can find the first sample-animal.rb over there at github. Deficits of this version:

Talk: Git Basics, Ariejan de Vroom

Summary

The Git Basics talk is geared towards people who want to use Git more effectively on a daily basis. Driven by real-life examples different git related techniques will be covered. From basic branching and tagging to how to manage/organise your repository. Special attention goes to hosting an open source project on GitHub effectively.

Autotest Revisited

I'm currently in the process of setting up a Rails 2.3 stack from scratch, and a few things have changed since the last couple of projects I worked on were tooled up.

Interesting Ruby Tidbits That Don’t Need Separate Posts #26

The latest installment of the series of posts crammed with random Ruby links, articles, and resources to kick off your week!

gogaruco.png

In Memoriam: George Carlin, 7 Words You *Can* Say on Twitter

Hate cuss words? Avert thine eyes! (What are you doing reading this blog, though, I'd be interested to know. Oh right. You already looked away. I'm just holding a conversation with myself. Ladeeda...

George Carlin is one of my heroes: hilarious, self-deprecating, edgy without being bitter, envelope-pushing without resorting to valueless shock, remarkably poetic, a dancer with dirty words, and, of course, in possession of an amazing voice I could listen to all day.

He's also dead. Goddamnit.

Talk: Mobilize Your Rails Application, Brendan G. Lim

Summary

Learn how to effectively take your Rails application into the mobile space using existing gems and plugins.

Details

Mobile communication and interaction shouldn't just be limited to voice. There are many ways to effectively take advantage of mobile technology that can help us build better Rails application tailored to portable devices.  Taking your application into the mobile space is easier than one would think.

Upgraded to iPhone OS 3.0 and running out of battery fast?

After upgrading my girlfriend’s iPhone 3G to OS 3.0 recently, I noticed that the iPhone’s battery was getting depleted really quickly. I’d left it overnight with Wifi, 3G, Bluetooth, Push Notifications all off, and the battery went from 80% to a jaw-dropping OMGWTFBBQ 10%.

I attributed it to the recent jailbreak (I’ve already removed the jailbreak trying to figure out this problem) at first. I only realized something was really wrong when the iPhone’s battery started draining while it was charging via USB!

String is a number?

I’ve been fishing around to see if Ruby has any way of telling whether a String object contains a valid number. The is_a? method looked like it might be a winner for a little while…

HTTP protocol | Rails Fire

HTTP protocol

Websockets made easy with Cramp

If you aren’t aware already, HTML5 has Websockets API – enabling bidirectional communication between client and server. You should check Ilya’s post Ruby & WebSockets: TCP for the Browser for a better explanation.

Ruby & WebSockets: TCP for the Browser

WebSockets are one of the most underappreciated innovations in HTML5. Unlike local storage, canvas, web workers, or even video playback, the benefits of the WebSocket API are not immediately apparent to the end user.

Cookie-based Sessions in Sinatra

Cookie-based Sessions in Sinatra

Julio Javier CicchelliThis is a guest post from Julio Javier Cicchelli.

20+ Rubyists are using Sinatra – Do you?

20+ Rubyists are using Sinatra – Do you?

With Sinatra you can quickly create your own tiny web-applications in Ruby and write lots of small services. RubyLearning caught up with some Rubyists working with Sinatra and asked them as to why, how and where they use Sinatra.

Fibers & Cooperative Scheduling in Ruby

Continuations have been a part of the Ruby API for quite some time, but for a variety of reasons have not seen much practical use: early Ruby 1.8 implementations suffered from serious memory leak problems, which were consequently mostly resolved, and the somewhat academic nature of the concept didn't help either.

Collaborative / Swarm Computing Notes

If you were looking for a great example of a collaborative map-reduce, then you don't have look much further than the amount of feedback and commentary that the earlier 'Collaborative Map-Reduce in the Browser' post received in a short span of twenty four hours.

Why learning HTTP does matter

It’s interesting to notice that there’s so many people working with web applications that don’t understand the basics of the Internet and the HTTP protocol. You might find applications that exibit bizarre behaviors anywhere, people just forget to read the specs or sleep during the HTTP protocol classes at college.

Syndicate content