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.