1. Play-By-Play: Layout

    July 9, 2010 by Craig

    I want to use HAML for my templates. I already have it installed; all I need to do now is convert the scaffolded ERB layout.

    html2haml app/views/layouts/application.html.erb app/views/layouts/application.haml

    One other thing I like to do is have the <title> and topmost <h1> tags have the same content. This is generally considered (by the SEO black-magicians)
    Change the so that it displays the Also have an h1 that contains this title. Set this variable on every page.<br />

  2. Play-By-Play: Heroku Setup

    June 7, 2010 by Craig

    Setting up the project is easy enough:

    heroku create softcraft-bakery

    Heroku creates a git repo for each project. I want to keep my main git repo on github.

    Add the heroku remote:

      git remote add heroku git@heroku.com:softcraft-bakery.git
      git push heroku master

    That gives me:

    -----> Heroku receiving push
     !     Heroku push rejected, no Rails or Rack app detected.
    This is caused by rails files being in a subdirectory of my git project. I don't want to mess around trying to figure out how to support an unexpected configuration, so I'll move everything up a level:

    rm README rm .gitignore git mv bakery/* . git commit -a -m "Moved rails files up a level" git push heroku


    -----> Heroku receiving push -----> Gemfile detected, running Bundler -----> Bundler works best on the Bamboo stack. Please migrate your app: http://docs.heroku.com/bamboo Unresolved dependencies detected; Installing... Fetching source index from http://rubygems.org/ Resolving dependencies Installing abstract (1.0.0) from system gems Installing actionmailer (3.0.0.beta3) from rubygems repository at http://rubygems.org/ /usr/local/lib/ruby/site_ruby/1.8/rubygems/installer.rb:186:in `install': actionmailer requires Ruby version >= 1.8.7 (Gem::InstallError) from /usr/local/lib/ruby/gems/1.8/gems/bundler-0.9.9/lib/bundler/source.rb:42:in `install' from /usr/local/lib/ruby/gems/1.8/gems/bundler-0.9.9/lib/bundler/installer.rb:30:in `run' from /usr/local/lib/ruby/gems/1.8/gems/bundler-0.9.9/lib/bundler/installer.rb:18:in `each' from /usr/local/lib/ruby/gems/1.8/gems/bundler-0.9.9/lib/bundler/installer.rb:18:in `run' from /usr/local/lib/ruby/gems/1.8/gems/bundler-0.9.9/lib/bundler/installer.rb:6:in `install' from /usr/local/lib/ruby/gems/1.8/gems/bundler-0.9.9/lib/bundler/cli.rb:60:in `install' from /usr/local/lib/ruby/gems/1.8/gems/bundler-0.9.9/lib/bundler/vendor/thor/task.rb:33:in `send' from /usr/local/lib/ruby/gems/1.8/gems/bundler-0.9.9/lib/bundler/vendor/thor/task.rb:33:in `run' from /usr/local/lib/ruby/gems/1.8/gems/bundler-0.9.9/lib/bundler/vendor/thor/invocation.rb:109:in `invoke' from /usr/local/lib/ruby/gems/1.8/gems/bundler-0.9.9/lib/bundler/vendor/thor/invocation.rb:116:in `call' from /usr/local/lib/ruby/gems/1.8/gems/bundler-0.9.9/lib/bundler/vendor/thor/invocation.rb:116:in `invoke' from /usr/local/lib/ruby/gems/1.8/gems/bundler-0.9.9/lib/bundler/vendor/thor.rb:137:in `start' from /usr/local/lib/ruby/gems/1.8/gems/bundler-0.9.9/lib/bundler/vendor/thor/base.rb:378:in `start' from /usr/local/lib/ruby/gems/1.8/gems/bundler-0.9.9/lib/bundler/vendor/thor.rb:124:in `start' from /usr/local/lib/ruby/gems/1.8/gems/bundler-0.9.9/bin/bundle:11 from /usr/local/bin/bundle:19:in `load' from /usr/local/bin/bundle:19 FAILED: Have you updated to use a 0.9 Gemfile? http://docs.heroku.com/gems#gem-bundler

    Now I have to set the Heroku "stack" (runtime environment & versions):
    heroku stack:migrate bamboo-ree-1.8.7


  3. Twitter

    November 4, 2008 by Craig

    I’ve finally figured out a use for Twitter now. Rather than IMing all of the minor snippets of thought I have throughout the day (and often duplicating those messages for multiple recipients), I just post them to Twitter and let the Internet propagate them.

    Here’s my twitter page for anyone who is interested.

  4. Do Weblogs Dream of Purple Cows?

    September 30, 2008 by Craig

    Both Ted and myself have recently taken an interest in the works of Seth Godin, one of the gurus of marketing in the Internet age. More than likely we were both influenced by the good things said about him on the Stack Overflow Podcast.

    Ted recently reviewed Purple Cow, one of Seth’s more famous books. He gave it a fairly negative review. I haven’t read Purple Cow or any of Seth’s other books yet (they’re still on hold at the library), but I have recently added his blog feed to my Google Reader. Based on what I’ve seen, some of Ted’s comments are right on the money:

    If I hadn’t been privy to the blogging phenomena, I’d probably have described this book as The Art of War for marketing, a collection of quips and anecdotes.

    The author builds some pretty big bridges over the chasm between cause and effect with bold and broad statements along the lines of “product X was crazy successful because of tactic Y,” glossing over any possible nuances of the relationship between the two or other possible external market factors.

    Even though I agree with Ted on what Seth does, I don’t get the same negative impression about the results. Much like the Sun Tzu work that Ted mentioned, Seth provides illustrative insights into high-level concepts. Ted is looking for details on how to implement those concepts. Both are important to have; Seth set the direction, the things that Ted reads describe how to get there.

    The most interesting part is that Seth left a comment on Ted’s review that said pretty much the same thing:

    If you don’t like short and provocative riffs, you’ll hate my blog, I promise. Just FYI, I’m told by happy readers that the book has provoked people to start things, fix things, earn a lot and have fun doing it.

    Seth wants to inspire people with grand visions, and hopes that inspiration will help people to discover solutions on their own. That’s a noble goal.

  5. Be a Team Player

    August 13, 2008 by Craig

    In many (most?) organizations, “being a team player” is code for “being nice” — which, in turn, is often code for “not contradicting anyone.” The problem with this is that it leads to groupthink and mediocre (or often just plain wrong) results.

    I think that this Slashdotter has it right: (emphasis added by me)

    I’ve worked for years in highly effective teams, and with success. I can tell you what made all the difference: The presence of equals to debate issues with, so that we could talk each other through the problems and emerge from the session with the feeling that we had defined better solutions. Perhaps we are all arrogant nuisances, but as long as we understand and respect each other we keep each other in check, and can function as effective team members.

    The “respect among equals” also translates to “respect among people above and below you in the hierarchy” when such hierarchies exist:

    • Listen to & consider what your boss says, but call him out on it when he’s wrong or hasn’t justified his assertions.
    • Listen to & consider the objections of those below your skill and/or station, but correct them when they’re mistaken and clarify the reasoning behind your positions.

    You should only be stating agreement when you reach the same conclusions based on the available information. If you don’t think you have enough information to defend a contrary position, it’s better to state that outright rather than agree by default. The lack of agreement, even without the presence of opposition, might be enough to show that the position is potentially unreliable.

    Being a helpful member of a team means working to achieve the same goal as the other team members. It does not necessarily mean following the same process.

    Update: Fixed the link to Slashdot. Sorry for that.

  6. Be Careful What You Ask For

    January 2, 2008 by Craig

    My sister-in-law’s friend is over for a visit, and she got a spam for penis-enlargement pills. This one was notable because it apparently came with before-and-after pics. (Why she bothered opening it in the first place is beyond me.) The novelty caused a minor stir with the women in the house.

    Here’s how the following conversation went. Keep in mind that Laura has a very gross sense of humor and barely cringes at anything.

    SIL: “I didn’t even want to see that. Now I’m afraid of the Internet.”
    Laura: “There’s nothing to be afraid of on the Internet.”
    Craig: [Starts snickering]
    Laura: “What?”
    Craig: “Oh there’s some things.”
    Laura: “Like what?”
    Craig: [Ponders] “…no, I can’t show you.”
    Laura: “No, show me!”
    Craig: “No, I can’t, it’s too bad.”
    Laura: “Come on! Show me!”
    Craig: [Gives into temptation, loads a certain link, and then ponders getting his camera].
    Laura: [Shock and Horror]
    Laura: “I didn’t want to see that.”
    Craig: “I told you so.”
    Laura: “I didn’t like that. Can you show me something happy?”
    Craig: “How about the Serta sheep? [Which under most circumstances would cheer her up.]”
    Laura: [Frowning] “I wish I didn’t see that.”

  7. Indexed

    September 4, 2007 by Craig

    Indexed is a pretty self-explanatory blog, once you see it.

    I like this one in particular, which Jessica Hagy did custom for Freakonomics Blog:

  8. Freakonomics Blog

    August 23, 2007 by Craig

    I’ve just discovered that the guys behind Freakonomics have a blog on the New York Times Website. And the peasants rejoiced.

    I liked this post in particular: Freakonomics v. Lolita: Can You Tell the Difference?

  9. Man vs. Machine

    April 6, 2007 by Craig

    Here’s your bit of meta for today:

    I’ve come to rely on other people rather than RSS feeds to point out the really important stuff to me.

    From I Need Smart RSS by Bruce Eckel

  10. Browser Wars 2.0: The Battle of the Dollar

    February 9, 2007 by Craig

    It’s been a long, sad story that the Powers That Be generally didn’t give a rat’s ass about any other browser than Internet Explorer on Windows. If they were enlightened, they might say “make it work in ‘both browsers'”, which meant Netscape 4.0 (which was such a crappy and divergent browser that you are better off not worrying about it).

    Times have changed. The combined efforts of FireFox, Opera, Apple, Google, and mobile devices mean that you can’t just target IE/Win any more; you have to consider all user agents. This quote sums it up nicely:

    Things are easier now that we no longer have to appeal to companies to be “better Web citizens,” which was like asking Nestle to promote fruit as a healthy alternative. Now we simply point out that over 90 million people don’t use Internet Explorer, and some of them just might have money to spend on your services.

    From Interview with Firefox Founder and Creator Blake Ros, via Cafe con Leche.

    It’s the “money” that’s the key here. PTB’s typically won’t listen to “this is better for all of us in the long run” but they will listen to “you’ll lose money directly if you do this”.

    The irony of this is that making your site IE-only is typically more difficult than it is to make it standards-compliant. It’s quite easy to make a site that is workable (although not necessarily visually perfect) in all major browsers. The reason many sites intentionally lock out non IE/Windows users is that they want their site to perfectly match what the Graphic Designers cooked up for them in Photoshop. A lot of times, you can’t do that without resorting to IE-only hacks. If you show them how bad it looks in any other browser, at best you’ll get “we don’t care”, and at worst you’ll get “then let’s block them from seeing it”. Either way, you’ll get “they’re only 0.1% of the market, they don’t matter.”

    Until now, that is.