64-bit MySQL, Ruby, Rails, RubyGems and Git installer for Snow Leopard

Snow Leopard
I took the release of Snow Leopard as an opportunity to do a clean wipe and re-install of Leopard and Snow Leopard. As usual, Dan Benjamin has a great series of articles on getting the latest and greatest setup.

I aggregated these articles into a bash script to automate installing MySQL, Ruby, Rails, RubyGems and Git.

Prerequisites
As Dan mentions, the prerequisites for this script are:

  1. Mac OS X 10.6 Snow Leopard
  2. The latest Xcode Tools (from the Snow Leopard DVD or downloaded from Apple — the 10.5 version won’t work)
  3. Confidence running UNIX commands using the Terminal

Caveats

  • This has only been tested on a completely fresh install of Snow Leopard, not recommended for upgrades
  • This will overwrite your existing ~/.profile

Instructions

  1. Download and extract the following gist: http://gist.github.com/178699
  2. $ sudo sh
    bootstrap_snowleopard.sh

When finished you will have 64-bit versions of MySQL, Ruby, Rails, RubyGems, and Git.

BONUS! Get the installers for Firefox, Adium and Textmate http://gist.github.com/178773

should_be_valid_with_factory macro for Shoulda/factory_girl

When writing unit tests I tend to 1) use factories instead of fixtures and 2) keep my factories in synch with model validations. As such, I like to write a test to ensure that out of the box a new instance of a factory object will be valid. Here is a macro to help out with that:



class ActiveSupport::TestCase

  def self.should_be_valid_with_factory
    klass = self.name.gsub(/Test$/, '').underscore.to_sym
    should "be valid with factory" do
      assert_valid Factory.build(klass)
    end
  end

end

Put this in your ActiveSupport::TestCase definition and it will be available in all your tests. Simply call it by name with no params:


class BuildingTest < ActiveSupport::TestCase
  should_be_valid_with_factory
end

Naming for this method was inspired by a similar method in Dan Croak's Blitz plugin.

“Are you on facebook?” Is this the new “Can I have your number?”

I am in the process of reading Socialnomics by Eirk Qualman.  His books talk about how social media transforms the way we live, the business we do and the world we live in.  In Chapter 4, Social-Media = Braggadocian Behavior, he talks about how social media is changing the way people date.

If we take a look at dating over the last 10 years, people use to give out their home phone number.  Then people started giving out their e-mail address instead, which led to cell phones and text messages.  Today people just ask “Are you on Facebook, hi5, or Linked In?” or another social media network.

Qualman goes on to say, “[Today] the first date is more like a fourth date, you aren’t asking questions like, ‘Where did you go to college?’ or ‘What are your hobbies?’” Common friends, photos along with what you do, and who you work for all provide insight into their personality.  “It makes you feel more secure knowing that the other person isn’t a lunatic.”  He later states that:

1 out of 8 couples married in the U.S last year met via social media

Some say that social media is a fad, others say that is revolutionizing society.  Check out this video, Social Media Revolution, to find more facts from Qualman to form your own opinion. Whatever social media is, it is definitely interesting to say the least…

Introducing the Public Shame 2000

We are in the professional services industry and our bottom line is directly tied to accurately estimating and tracking the hours of work that our resources spend on a project. I’m sure I’m not alone in struggling with the perennial problem of getting our team to “enter their time.” We use a home-grown system called “Homefry” which is integrated with Quickbooks and helps us track everyone’s time against particular job codes.

Everyone has different habits for keeping track of their time—some people jot down their time on a notebook and enter it all in at the end of the day or end of the week. Others use virtual post-its on their desktop, and others use their outlook calendar. Most people, do not enter time as they go, and as a result most people are always behind and trying to catch up on their time entry. This makes accurately reporting on budget vs. actual for various projects very difficult.

A few years ago I heard of an agency that made people sing “I’m a little teapot” whenever someone showed up late for a meeting. In that vein, I decided it was time to implement an incentive, something from the negative reinforcement camp (I don’t think a reward for most up-to-date time would work).

Introducing the Public Shame 2000. We purchased this device from Karaoke.com a few weeks ago, and the mere threat of having to perform karaoke (sober) in front of the entire office during our Tuesday morning staff meetings has been enough to nip this problem in the bud once and for all. I’m pleased to report that everyone’s time has been consistently up-to-date since the day we introduced this machine.

We have yet to turn on this machine, however, I’m sure that day will come at the next after hours office party.