From the monthly archives:

October 2010

I’m trying something new and using the YouTube player. Let me know if you see any differences.

In this video, I demonstrate how to create, merge, and delete local and remote branches in Git.

Git is a Source Control Management system written by Linus Torvalds for managing development on the Linux operating system.

Download (29.3 MB)

Download (iPhone & iPod) (16.3 MB)

{ 23 comments }

In this podcast episode, I discuss writing unit tests vs integration tests and why you need both.

Here’s the link to Ben Mabey’s talk on Cucumber.

You can also find out more about Cucumber in the Screencasts and at cukes.info

Download this Episode

{ 3 comments }

I’ve recently been working on http://tweetburner.com cleaning up the code and fixing some of its issues. One of the problems that is more of a business problem than a problem that the users would see was that a lot of spammers were shortening URLs through the service.

So, one layer of new security in going into place is integration with Project Honeypot’s HTTP:BL API. Now, identifying spammers doesn’t necessarily belong is the “core” of a URL shortener. And, other people may want to integrate this into their own sites to block spammers from commenting on their blogs, using their services, or any number of other things. So, I’ve put the gem up on http://rubygems.org.

You can also check out the source code here.

If you want to use the gem, go to http://projecthoneypot.org and sign up for an account. That will get you an API key for the service. Then you can install the gem:

gem install project-honeypot

And then do a lookup call:

ProjectHoneypot.lookup("myapikey", "192.168.1.1")

You’ll get back a Url object that gives you information about the ip address. You can get more information on what this looks like in the README on the Github page.

{ 3 comments }

I got an email from someone who enjoys Teach Me To Code. He was having a problem getting gems. Anytime he tried to install a new gem, he was getting this response:

ERROR:  While executing gem ... (Gem::RemoteSourceException)
    HTTP Response 302 fetching http://gems.rubyforge.org/yaml

I told him to try running ‘gem update –system’ which will update RubyGems itself. He did and got the same error.

He told me then that he was running RubyGems 1.0.1. Aha! That’s the problem. If you’re running into this problem, here’s what you do:

  1. Go to http://rubygems.org
  2. Download the RubyGems .zip or .tar.gz file
  3. Unzip or untar the file you just downloaded
  4. Change directories to the directory created by unzipping or untarring
  5. Run ‘ruby setup.rb’

It will build RubyGems from scratch and replace your ‘gem’ executable. Then ‘gem’ will connect to http://rubygems.org and pull the gem libraries in properly.

{ 33 comments }

Hey, do you like books from the Pragmatic Programmers? Do you like Peepcode videos? So do I!

Here’s the deal. I’ve set up a survey at http://teachmetocode.com/survey. Anyone who takes the survey will be entered to win 1 of 5 Pragmatic Programmers books/videos and 1 of 5 Peepcode videos.

So, if you want a chance at a free video or book, then go to http://teachmetocode.com/survey and take the survey. I really appreciate the feedback.

{ 2 comments }

I was setting up a new project/gem that interfaces with Project Honeypot. While I was setting it up, I ran into a couple of problems running my specs. The first one, I hit this error while running ‘bundle exec spec spec’:

/usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.2/lib/bundler/shared_helpers.rb:137:in `bin_path': can't find executable spec (Gem::Exception)
	from /usr/local/bin/spec:19

What this means is that the spec gem doesn’t have an executable called ‘spec.’ This confused me since all of the previous versions had been run with a ‘spec’ command. As it turns out, in RSpec 2.0.x, the command to run your specs is ‘rspec,’ not ‘spec.’ So a ‘bundle exec rspec spec’ got around that error.

The next issue I got was an undefined constant error for ‘Spec::Runner.’ Here is my spec_helper where I was referencing Spec::Runner.

require "rubygems"
require "bundler/setup"
require "rspec"
require "flexmock"
require File.dirname(__FILE__) + "/../lib/project_honeypot"

Spec::Runner.configure do |config|
  config.mock_with :flexmock
end

So, RSpec has changed the configuration setup to use RSpec instead of Spec::Runner and it worked like a charm.

You can check out the respository I was working in at http://github.com/charlesmaxwood/project_honeypot.

{ 0 comments }

This week’s interview with Peter Cooper was terrific! He talked a lot about entrepreurship and social media.

A few sites that he has set up are:

You can also find out more about him by going to peterc.org and twitter.com/peterc

Download this episode

{ 2 comments }

I got an email from someone dealing with Legacy Code and decided to discuss some of the principles of working on Legacy Code.

I mentioned Working Effectively with Legacy Code(affiliate link) by Michael Feathers.

Download this Episode

{ 0 comments }

I started contracting about a week ago. So far, I’ve really enjoyed it. It’s a little stressful trying to line up work, but I’ve worked with some great clients.

At the end of last week, I actually got a job offer. (I got laid off about 3 weeks ago.) The offer was extremely tempting. The money was good. The company seemed like a great group of people to work for and with. The problem was that I’ve been wanting to be self employed for a long time now.

There’s a certain amount of freedom that appeals to me regarding self employment. But I’m extremely accustomed to working for someone else. So, what should I do?

I asked a few people on Twitter. Here are some of the answers I got and my reactions to them.

A local guy wrote:

For me, biggest drawback w/ contracting was working alone at home; I have a hard time staying focused if I am not working with others.

My business coach had me take a DISC profile that indicates your personality. I’m extremely high I and a high D. That means that I thrive on interacting with people and like being the one that’s making decisions. The interaction is important. However, it’s not because I struggle with staying on task. It’s because I’m wired to thrive off of interpersonal interaction, which I might not get working from a home office.

My business coach wrote:

there are no easy decisions. I get stumped over “Do you want fries with that?”. Whatever you do will be the right way to go.

Not profound advice regarding what to do, but it helped me realize that I was making a decision between two good alternatives. So, I wouldn’t lose by going one way or the other.

Finally, Evan Light, who I met at Ruby|Web Conference send me a series of messages that condensed to something like this:

What is your tolerance for risk (e.g., not getting paid for months at a time)? Do you have savings that you can COMFORTABLY use?
How strongly do you feel about “being your own man” or owning your own small business?
Do you have something that YOU want to build and don’t want to compromise on how and what to build?
OTOH, does the FT gig offer you chances to grow in ways that matter to you, does it pay the bills comfortably, do you like who you would work with? Those are all of the key questions that come to mind for me
When you get down to it, other than being able to pay the bills, the job you pick is more about (1) what feels good now, and (2) will it lead to more good feelings later.

This is what ultimately helped me make up my mind. Now, I want you to keep in mind that there were no wrong answers here. If I had answered them differently, the full time job probably would have won out. Here’s how I answered these questions.

What is your tolerance for risk (e.g., not getting paid for months at a time)? Do you have savings that you can COMFORTABLY use?

This one is tricky. I don’t have much in savings at the moment. Which means that this is something that could come back to haunt. What I really boiled it down to was. I need to verify that I have the means to earn a cash buffer if I’m going to make this work. In other words, I need a client who will provide me work long term and pay me enough to put money away every month.

How strongly do you feel about “being your own man” or owning your own small business?

I’m not so much interested in “being my own man” as much as I like making decisions. I’d love to own my own business, but really, I just want to help people learn to do what I love to do: write awesome software. Self-employment just allows me more freedom to do that.

Do you have something that YOU want to build and don’t want to compromise on how and what to build?

That would be a solid yes. I hate it when I have to skip steps, like testing, to “get the job done.” Because to me, the job is not done without the tests. How can you verify what it does, refactor, or enhance it later if you don’t have tests?

OTOH, does the FT gig offer you chances to grow in ways that matter to you, does it pay the bills comfortably, do you like who you would work with?

This was the major kicker. The answer was “no.” on the count of helping me grow in ways that matter to me. The other counts were “yes,” but the growth opportunities are things that are important to me. So, I turned the job offer down.

I did what felt good.

{ 4 comments }

Twitter just turned off Basic Auth and is forcing application developer to use OAuth. Here is a demonstration of how to add Twitter OAuth to your Ruby on Rails Application.

Download 90.9 MB
Download (iPod & iPhone) 45.6 MB

{ 24 comments }