Gary Haran.com


Campfire Without Getting Burned (out)

Posted in Uncategorized by gary.haran on the March 5th, 2008

At Standout Jobs we’re lucky enough to all use Campfire to coordinate. It’s especially good on a day like today where we have 20cm of snow on the ground. We can work from wherever we want and still be able to work as a team regardless of geography.

There is one problem with campfire: it can get pretty noisy. My brother offers a nice solution to let you know when Campfire message are directed at you so you can ignore them the rest of the time.

Here are instructions on how to set it up for yourself.

It assumes that you are using OS X 10.5 (Leopard), that you can edit ruby files and that a little system plumbing doesn’t scare you.

Get Growl (if you don’t already have it)

Growl is a notification system for Mac OS X: it allows applications that support Growl to send you notifications. In our case it’s exactly what we need.

Adjust Script

#!/usr/bin/ruby
# http://www.danielharan.com/2008/03/05/campfire-better-growl-notifications/

# Originally from http://forum.karppinen.fi/forums/3/topics/62
@udp_pass         = 'mypass'                        # this is any password you feel like... you will need it later
@campfire_user  = 'gary@standoutjobs.com'  # this is your campfire login 
@campfire_pass  = '321654987'                   # this is your campfire password 
@campfire_room = 'Main Room'                   # campfire room you want to track
@regexps           = [/ALL/i, /GH/Gary/i, /reception-trunk/] # adjust this to your liking

# Start of CampfireGrowler.rb
require 'rubygems'
require 'ruby-growl'
require 'tinder'

growler = Growl.new("localhost", "ruby-growl", ["ruby-growl Notification"], nil, @udp_pass)

campfire = Tinder::Campfire.new 'standoutjobs'
campfire.login @campfire_user, @campfire_pass
room = campfire.find_room_by_name @campfire_room

room.listen do |m|
  if !m.nil? && m[:message].size > 1 && @regexps.any? {|e| e =~ m[:message]}
    growler.notify "ruby-growl Notification", m[:person], m[:message]
  end
end

Save this script in a secure place. I saved mine as ~/Library/GrowlingExtras/CampfireGrowler.rb.

Set permissions

$ chmod +x ~/Library/GrowlingExtras/CampfireGrowler.rb

Download Lingon

Lingon is a graphical user interface for creating launchd configuration files for Mac OS X. We’ll use it to create a start item.

Create Your Startup Agent

- Open Lingon
- Click New
- 1) Name: com.growl.GrowlingExtras
- 2) What: /Users/#{your OS X name here}/Library/GrowlingExtras/CampfireGrowl.rb
- hit save
- restart system

Setup Growling Preferences

Go to System Preferences > Other > Growl > Network

- Enable [] Listen for incoming notifications
- Enable [] Allow remote application registration.
- type in the @udp_pass you had in your rb file: ‘mypass’

Happy Growling!

Rails Development With The Thin Web Server

Posted in Uncategorized by gary.haran on the February 21st, 2008

Thin is all about speed, security, stability and extensibility. If you haven’t seen the Thin Web Server benchmarks perhaps you should but that’s just good for pissing contests. True class is when you can package it all for better development as well.

One would think that because thin is so good with the stated goals that it would fall short when it comes to flexibility.

If you think that, you’d be wrong. After just a day running Thin in development mode I’m never using script/server again. I’m addicted to thin and I don’t mean in the anorexic way. This server can do gymnastics and lift heavy weights. It’s so easy to setup and use that you can expect lots of people to adopt it.

Want to learn more? Yes! Well let’s get started then!

Installing and Using Thin Web Server

$ sudo gem install thin

That’s it! You’ve just installed thin!

Starting thin instead of mongrel

In the root of your rails application:

$ thin start

This replaces script/server. Restarting is as easy as:

$ thin restart

Or if you want to stop Thin:

$ thin stop

And the good news is that you can do that from any console!

That’s pretty much vanilla flavor and by default it doesn’t spit out the logs to the console so you get extra speed right from the get go. But what if you want to see the logs?

Run Thin And Logs In A Single Console

$ thin start -d
$ tail -f log/development

Of course you can always run tail -f log/development in another tab or console. It’s all up to you! That’s what I call flexibility!

Advanced Development Options

I rely a lot on the front end tools such as Firebug to determine what’s being sent in Ajax calls but lately I had to determine what was being sent to and from a Flash Uploader.

There are some firefox plugins that exist that tell you what’s going on in http headers and what’s being sent. Unfortunately when you have 3 different version of Firefox installed in virtual machines it’s time consuming to install it everywhere. This is where the tracing option comes in handy in thin.

$ thin start -V

Now when you send a request you get the content of files displayed in your console and the status code that look like the following:

HTTP/1.1 200 OK
Content-Type: text/plain
Content-Length: 26999
Connection: close
Server: thin 0.6.4 codename Sexy Lobster

<!DOCTYPE html PUBLIC...

Of course piping all text through your console should only be used when you absolutely need to see the messages going back and forth so only use it when you want less speed in favor of more information. It’s all about flexibility!

RubyFringe Registration Is Open

Posted in Uncategorized by gary.haran on the February 18th, 2008

RubyFringe is an avant-garde conference for developers that are excited about emerging technologies outside of the Ruby on Rails monoculture. We’re sick of the sold-out and over-sold labradoodle shows that are now staged with alarming frequency. In response, we’re mounting a unique and eccentric gathering of the people and projects that are driving things forward in our community.”

Organized by the Unspace crew so you can expect nothing but the very best!

I believe a few people from Montreal are making their way there so we might have quite the party. You can register right now to take advantage of the early bird special.

Excellent Podcast With Fred Ngo On Recruiting

Posted in Uncategorized by gary.haran on the February 15th, 2008

Fred Ngo just sent us a link to an interview he had where he speaks about the recruiting tool we have at Standout Jobs. In this podcast Fred explains the reason why we’re different than other tools out there. It does explain a bit better what our startup is all about.

« Previous PageNext Page »