Startup Fever

It’s time for a new chapter.

I’ve been a terribly inconsistent writer on MyOwnPirateRadio over the years. I’ve written sporadically. I’ve written snotty rants, mind-numbing trivia, and esoteric technology crib notes. I’ve written about completely random and unrelated topics. In short, I’ve written so poorly that only my most patient, masochistic, and excitement-starved readers are still around. (Hi, mom! Oh, wait, she doesn’t have an internet connection.) So, dear reader(s), I’m sorry. I apologize. I’ve been a shit.

But I do want to write — it makes me happy — and so I’m going to start again.

I will write about one topic:

Life trying to get startups off the ground.

This will not be “How I succeeded at getting my startup off the ground”, or “My genius recipe for gobsmacking success in startup life”, or, ”How I built and sold my company for $10M in just 3 months with only 8 toothpicks, a pair of tweezers, and a tenth of my staggeringly massive brainpower, bitch”. This is not one of those blogs. Gloating will be kept to an absolute minimum. I intend to write more in the vein of “How I’ve worked like crazy on too many projects at once for 5+ years with little to show for it except a much smaller bank account, a bunch of hard-earned lessons, and a smug sense of satisfaction. Please send help.”.

I will write as openly and honestly as I can.

I will try really hard to write regularly, at least once a week.

I will spend no more than 30 minutes writing a post.

I will avoid the temptation to portray this lifestyle as glamorous. ‘Cuz it ain’t. Read me?

And I want to feel good about doing this. I have a lot of “priority guilt”… why write blog posts when I should be writing code, helping out at home, doing some exercise, or becoming a better husband and dad? I also fear the embarassment of screwing up in public. But I’ve come to grips with a few realities: I need to write; my privacy is largely an illusion anyway; and I’m much less interesting to everyone else than I like to think.

I’ve put off starting this for a very long time now, so I’d better post this before I manage to stop myself again.

So here goes: Startup Fever. Wish me luck.

P.S. How Canadian of me, to start off with an apology. Represent!

Getting Heroku Cedar and Rails 3.1 Asset Pipeline to Play Nicely Together

I recently migrated a Ruby on Rails 3.1 app from the Heroku Bamboo stack to Heroku Cedar. If you’re doing the same, here are a few notes to help avoid snags on getting the Rails Asset Pipeline working efficiently.

Unlike Bamboo, Cedar does not offer Varnish as a reverse proxy cache, nor does it automatically gzip content. You need to do it yourself. Heroku recommends:

  1. Use memcached, with Dalli as the memcached client. Make sure to follow the Rails 3 section.
  2. Use Rack::Cache as a substitute for Varnish. Heroku links to this article which explains how to integrate Heroku with Rack::Cache. I couldn’t get it to work, so I hunted around and pieced together the folllowing riff.
In your runtime environment file (e.g. production.rb), add this:
require 'rack-cache'
My::Application.configure do
...
  # Enable Rack::Cache
  config.middleware.use Rack::Cache,
   :metastore => "memcached://#{ENV['MEMCACHE_SERVERS']}/meta",
   :entitystore => "memcached://#{ENV['MEMCACHE_SERVERS']}/body"

You can also set HTTP headers in production.rb as follows. (3600 is an example value, make this whatever you want.)

# Add HTTP headers to cache static assets for an hour
config.static_cache_control = "public, max-age=3600"

And you may want to add this to your config.ru to get gzip working:

use Rack::Deflater

References:

Follow

Get every new post delivered to your Inbox.

Join 401 other followers

%d bloggers like this: