Matthew Lang avatar

How to Run Cheaters with Pow

Brett Terpstra released a new version of his Cheaters cheat sheet system. Brett recommends two options to get this running. The first is using the Automator application in OSX and the second is using the Fluid app.

The one change I wanted to make was to make Cheaters run as a local Rack web application with Pow rather than from the already installed Apache instance. It's easy to do.

1. Create a Gemfile

Create a Gemfile within the root of the Cheaters source and include the Rack gem:

gem 'rack'

Jump back to the command line and run the bundle command to install this gem.

2. Create the Rack App

Next create the Rack file that will serve all the pages and assets from the Cheaters source. I've used this same code for lots of Rack applications.

require 'rack'

$stdout.sync = true

use Rack::Static,
  :urls => ["/css", "/js", "/images", "/cheatsheets"],
  :root => "."

run lambda { |env|
[
  200,
  {
    'Content-Type'  => 'text/html',
    'Cache-Control' => 'public, max-age=86400'
  },
  File.open('index.html', File::RDONLY)
]}

Put this in the root of the Cheaters source.

3. Symlink Cheaters

Now I'm assuming that you have Pow installed already. With Pow installed, change to the pow directory and symlink your Cheaters directory:

cd ~/.pow && ln -s /path/to/cheaters

I also use an app called Anvil that gives me access to my running web applications in Pow from the menubar. This can also create the symlink for you if the terminal is too scary.

Done!

That's it. Now if you visit [cheaters.dev](http://cheaters.dev), you'll find the Cheaters page. The reason I prefer this is that I already have a number of application running locally that I like to use, so running it from the browser is fine with me.

Solutions with Code

As a freelance developer working for a client, I don't have the luxury of daily stand ups to get the outline for a new feature I have to work on. I also don't have the benefit of having another programmer sitting beside me or even in a remote location to talk about the feature further in a pair programming session. When you're on your own, you need to find other ways to kickstart the development process of envisioning a feature of a system.

I generally have a rough idea of the feature, but sometimes even getting a rough idea can be difficult. It pays to talk to the customer or even the product owner to get all the details you need, but sometimes even after that you might still be unsure. Where I usually falter is that I understand the feature but seeing it in code or as a set of objects can be difficult.

One technique I've been using is writing the sample code of how I would eventually interact with the feature once it is shipped. This isn't production code or code that's even going to be run. It's just me hammering out sample code on text file. The benefit of this technique is that I can identify simple objects such as classes and properties without too much code. It also lets me see if I'm starting to build dependencies on other objects. It might not be viewed as TDD friendly, but when you're working on your own, anything that helps should be considered.

The code itself consists of creating a couple of instance objects and setting the attributes needed for each one until I've satisfied the need to have a set of objects that could be read from a database. There's no fancy Rails code here, it's just plain old Ruby. I don't even bother to refactor it at all as I'm just looking to get an initial design from the code. Then I can start TDD'ing the feature with the my new found understanding.

I've no idea if this technique has a name or not, but it works well for me when I have problems envisioning the design for a feature.

Time to Grow?

I always keep my ear to the ground when it comes to local businesses starting and closing in my local town. You never when an opportunity might arise.

A couple of months ago I noticed that a hairsdessers, whom I used to be a customer of and got to know the owners well, had closed down. This morning I found out that the owners (a married couple) were still working locally, but had decided to rent chairs in another local hairdressers so that they could continue to serve the customers that they had built up in their own business.

Being a business owner with staff is a huge responsibility and one that isn't easy to depart from. Once your employing staff and delegating duties to them, it's your responsibility to steer the business in the best possible direction, whilst also ensuring that your staff contribute and are paid well for their duties.

I've been in enough small businesses over the years to see this first hand. Sometimes the business owner does a good job and sometimes they don't. The majority of the time though, I've seen the bad side of this. The business as an entity isn't doing well enough to support it's staff which usually results in the laying off of some or all of those staff.

For whatever reasons you have as a business owner for closing down your business, it can't be an easy decision to make when there is staff involved. If you've built up a loyal army of staff over the years that can be depended upon, how do explain that they no longer have a job when your business closes?

As much as I would love to expand my freelance business over the coming years into a registered company with staff, I keep having to remind myself that there's a huge responsibility to employing staff and ensuring that there is enough there for people to be paid. I've been on the receiving end of three redundancies. I'd rather not be the guy on the other side of the table giving them out.

For the moment I'm happy to plod on as a single freelance developer providing a service and value to my clients. I only have myself and my family to look after and that's enough for me.

One thing that I will need to focus on this year is increasing my client rosta for my freelancing business. With just a handful of clients at the moment, I definitely have enough work to keep me going for the foreseeable future, but what happens when the work for those clients dries up? At the moment I have enough savings to see me through a few months of absolutely zero work, but that's not the fallback plan I had in mind.

Before I actually find clients though, I need to determine what value I can offer these clients, and that's where I need to start work. Approaching clients is one thing, but unless I can sell something of value then I am definitely not going to appeal to anyone.

Technical Value

Looking back at the last year of work, it's clear that my strengths now lie in the following stack for web development:

  1. Heroku for application hosting.
  2. Ruby on Rails as my chosen web development framework.
  3. Cucumber and RSpec as a testing stack I'm well versed in but I would actually prefer to be digging more into MiniTest, the test library that is now included in Ruby.

Selling this as a value though could be done with testimonials from my current customers, as well as showcasing some of the web sites that I have worked on over the last year.

The other option for displaying my value on this topic would be to write a book on one aspect of my development stack. I am leaning towards Heroku as a favoured choice having seen very little books in the past on Heroku. However Heroku is such a well documented service, would I be simply duplicating the docs that Heroku have? I would need to provide something more than the basic docs. Tips and strategies on getting more from Heroku while being able to keep costs down would be a good place to begin.

Knowledge Value

As for the my specialised field, I've been building web applications in the healthcare sector for the last 12 months. It's a sector I'm very experienced in having previously worked in the NHS and also having worked for a software provider whose main customer was the NHS.

For a product idea, I am currently building a CMS targeted at GP surgeries in the UK. The proving ground for this product is going to be the GP surgery where my wife is the practice manager. While building the CMS for this practice, I'll be able to get invaluable feedback from my wife who will be the administrator for the site.

Having this knowledge of the health sector would allow me to focus my attention on chasing clients similar to this. While many developers might have the technical skills that match mine, I will be the more valuable option for having the knowledge of the sector to help these clients.

I'm definitely not setting this in stone as the only two options for the year, but it's a start. I'm putting an emphasis on these two forms of value, as I am trying to attract clients that are looking for either of these forms of value, but it would be ideal if they needed both.