Jordan Brock

CoffeeScript, bistro_car, homebrew, and passenger gotcha

Apr 08, 2010

File under “Things for me to remember when reinstalling stuff”

For me, one of the best things about using Ruby/Rails/Sinatra for web development is HAML/SASS, which allow me to quickly write and maintain HTML/CSS without having to worry about all the pointless stuff, like brackets etc. A by-product of using HAML/SASS is that when you have to write in something else, it causes me grief. JavaScript is a case in point.

Coffeescript (and to a lesser extent) bistro_car solve this. It brings the beauty of a ruby-like language to writing JavaScript, so that once again you don’t have to worry about all the crap that goes along with it.

However, I ran into a slight problem when following Dr Nic’s setup tutorial today. CoffeeScript worked, bistro_car worked within the console, but it didn’t work when accessing the page through the browser. But some path re-working, and a kind word or two from @sutto, and we’re good to go.

For future reference, here’s what I did. I’m using the homebrew package manager. Mainly because it’s awesome, and I use MacOS X, which is also awesome.

So, I installed node.js, coffeescript and bistro_car like so:

brew install node
brew install coffee-script
gem install bistro_car

Then, add the following to your environment.rb file:

config.gem 'bistro_car'

Create an ‘app/scripts’ directory in your Rails app, which is where you can store all your .coffee files (application.coffee etc).

You then get bistro_car to include those script files by putting this in your layout/template/page/whatever:

coffee_script_bundle

Then, you load the page, and bistro_car automagically uses coffee-script to convert your .coffee files to javascript. Except, of course, when it doesn’t work because something is screwed somewhere.

As with almost every problem on a *nix computer, the problem is a path one, and thankfully solved with some simple symlinks. It seems passenger operates in it’s own little world when it comes to paths, and it just didn’t want to play nice with my environment. So, I tricked it as follows:

sudo ln -s /usr/local/bin/coffee /usr/bin/coffee
sudo ln -s /usr/local/bin/node /usr/bin/node

And that, my friend, is how you skin the unix path cat.

Back from the Edge

Nov 12, 2009

Last week, I was lucky enough to be involved with the 2009 Edge of the Web conference, which was organised by AWIA and Red Horizon Events here in Perth. We had speakers from around the world, around Australia and from Perth, who all gave great talks to an eager and attentive audience.

My role at the conference was basically to be the room monitor for the main auditorium, which meant that I only really got to see those speaking in that room. As a result, I didn’t really get to see all that I wanted to see, but I can’t complain in the slightest, because there were some fantastic presentations. And I got to see them for free. Which was nice.

So, here’s a brief run-down of who I saw, and what I remember. Unfortunately, I didn’t have a chance to take notes, so some of this is going to be hazy.

Anil Dash (@anildash)

For a few days it looked as though Anil wasn’t going to be able to make it to Perth at all. Some last minute flight shuffling, and some program jiggling saw our opening and closing keynotes swapping. This meant that Anil would be able to come, and I’m fairly sure everyone was glad that he did. It was the perfect opening for the conference: an inspirational call to arms, urging us to embrace the open web and build the apps and sites that people will be talking about. Perth can be isolated, both mentally and physically, and it was great to hear someone talk about breaking the myth of Silicon Valley.

Just a quick time out to thank Anil for his superhuman efforts in coming to speak. He ended up only being in Perth for about 35 hours, and spent 45 hours travelling to do that. I can’t imagine how he felt at the end of the trip. Thanks heaps Anil.

Lachlan Hardy (@lachlanhardy)

Having received the perfect lead in from Anil, Lachlan spoke in depth about the open web, the technologies available and the ethos behind keeping information free from copyright and the patent-lock. A great talk that hopefully encouraged attendees to challenge themselves to use open technologies.

View on slideshare

Dmitry Baranovskiy (@DmitryBaranovsk)

Always entertaining, Dmitry has the knack of making a detailed and technical journey into the world of JavaScript highly entertaining. Quote of the day: “The public scope in JavaScript is like a public toilet. You don’t know who’s done what in there, but if you have to use it, touch it as little as possible”

View on slideshare

Nick Cowie (@nickobec)

Local web legend Nick Cowie gave an informative talk on some of the upcoming features of CSS3, and how well they are supported in local browsers. He had a surprising example of some features that are supported by even the venerable IE6. One for the code monkeys.

View on slideshare

Alex Payne (@al3x)

Alex gave the opening keynote on day 2, and it was a great start to the day (ok, the coffee was the real start to the day). He spoke about how the languages and tools that we use shape the way that we approach our work. Watching Alex’s talk, I was reminded of his tweet from when he was researching the talk:

bq. “Researching tech history is a good reminder not to get too worked up about the tech of today. It mostly looks ridiculous in ten years.” - http://twitter.com/al3x/status/5327550871

While we all love a good language fight every now and then, seeing a laundry list of forgotten languages, specs and companies certainly showed that it’s not worth getting too worked up over.

Quote of the day: “Throw the wallaby over the bush fire.”

View on slideshare

Kevin Yank (@sentience)

Being entirely in love with HAML and SASS I had only paid the slightest of attention towards CSS frameworks. Kevin gave a good run through of what they are, when they’re a good idea, and how they work. I suppose it made an impact, because I actually started using aspects of the 960 Grid on a project at work.

View on slideshare

Ash Donaldson (@ashdonaldson)

Unfortunately, I only got to catch the last part of Ash’s talk, so I can’t really say a great deal about it, except that he has introduced me to an insanely addictive iPhone game: Doodle Jump

View on slideshare

Malcolm Day

After two days of talking about the benefits of various development methodologies and discussions on W3C standards and the like, it was refreshing to hear a talk about money, and to earn it. Malcolm, CEO of Adult Shop (NSFW!), gave an entertaining (and potentially libellous) talk on his journey from being an engineer for a mining exploration company to the CEO of a publicly traded ecommerce company.

Derek Powazek (@fraying)

Wow, what a close! Derek was an exceptional presenter, taking us through the types of “crazy” that we encounter while building communities on the web, and how to deal with each of those crazies. Highly entertaining and hilarious, it was a brilliant end to the conference.

View on Slideshare

I’d like to thank everyone involved in the conference, particularly the AWIA events committee (Myles, Miles, Kay and Helen) for their tireless efforts in putting on a wonderful show. I’d also like to give props to our international speakers, for taking time out of their lives to travel to the other side of the world to give a little something to the Australian Web community.

Edge of the Web - Derek Powazek

Oct 08, 2009

Derek Powazek is presenting the opening keynote at the upcoming edition of the Edge of the Web conference in Perth on November 4-6, 2009. He will be talking on the “Wisdom of Community”.

_Your keynote at Edge of the Web is titled “The Wisdom of Community”. How do you define a community on the web?_

I like to take the broadest possible definition, so I’d say that a community is any group of people brought together by some common denominator. Lots of things have invisible communities around them - people who care about that thing - even if they haven’t ever met each other. The web gives us the power to find each other, which is why it’s such a powerful, and terrible, place for social interactions.

_It seems that, given enough people, a comment thread can quickly devolve into rapid fire insults and grandstanding. How can we foster and encourage thoughtful commentary and participation?_

There are two parts to this, and you can only control one of them.

The part you can’t control is human nature. People are weird, messy, and complicated. They react strangely to things. They behave irrationally in groups. And you can’t change that.

The part you can control is how your website interfaces with that strange mass of humanity. Certain interfaces stand up better to the weirdness of humanity than others. It takes a lot of trial and error, and the line is always moving because we’re evolving.

We’re all still learning how to behave online. It’s the first time in human history that you can be both alone and in a group at the same time. How weird is that? It’s no wonder we haven’t figured it out yet.

_One of the benefits of investing your time and efforts in building a community is the the personal rewards that come from interacting with the members of the community. One of the perils of that can be when things start to go wrong and it can lead to heartbreak. You had a fairly public parting of the ways with JPG Magazine. Not wishing to get into specifics with you, but how hard was that to deal with, and did the community that you and Heather helped foster help you “heal”?_

JPG was an enormous learning experience for me, both for what I learned about fostering creative communities, as well as learning some hard truths about founding a company. There are a million stories out there about founding partners in a startup falling apart. In fact, it’s probably what happens more than anything else. The only difference in this case was that I chose to talk about it publicly. I did that because I had to - the community that built JPG deserved to know what happened. But one side-effect was that many other founders and entrepreneurs came out of the woodwork to tell me their stories. It helped me immensely to know that I wasn’t alone.

The web never ceases to amaze me. When you approach it with honesty, it comes back a thousand fold.

_With seriously large amounts of money going after the “Social Web”, do you see people having multiple social locations (eg facebook, twitter, flickr, Goole Reader etc) as a hinderance, or does this fragmentation actually help, by allowing us to compartmentalise our social interactions into different areas, much like we do in our offline lives._

Good question! To a geek, this repetition of signup, login, create profile, over and over, just seems like an inefficiency. But people are inefficient. We all maintain multiple identities already. Who we are with our parents isn’t the same as who we are with our friends. So I’m not as bothered by all these disparate digital identities as some. In fact, I think trying to meld them is going against human nature.

_“Strange Light” was an intensely quick project, born from an idea and fully realised in less than two days, and seems to have had an incredible response both from photographers and from the web at large. Do you see these magazines as having their own community? Or one that augments existing online ones (such as flickr)?_

I think that magazines are, essentially, communities. At least, the successful ones are.

In the case of the first issue of Strange Light, there were two groups out there: the people who experienced it were a community of experience, and the rest of us who saw the astounding photographs coming out of the storm formed a loose-knit community of interest.

I was hoping that a few of those two groups would want a beautiful printed edition of photos from the storm, and they did! What I like about this is it allows the web to do what it’s good at (connect people) and print to do what it’s good at (create a coveted object).

_And finally, when the hell is MagCloud going to deliver to Australia? It’s not like we’re on the other side of the world or something._

The short answer is, I don’t know. But I can tell you why it’s complicated.

Most of the printed matter around you right now is printed in China, put on a boat, and then a truck, maybe a train, and then another truck, and finally makes its way to you. It’s horribly inefficient and disastrous for the environment.

MagCloud is changing all that, because we’re going to have print partners all over the world. So when you buy a magazine on MagCloud, it’ll always be printed as near to you as possible. That way the buyer pays less, the publisher makes more, and we expend less carbon shipping paper all over the world.

But that means shipping is much more complicated than just licking a stamp. We’re setting up printing partners as quickly as possible, but it takes time. We’ll get shipping here as soon as possible. Promise.


Derek will also be running a workshop on “Creative Community Building. Tickets available now!

Setting up AutoTest on Mac OS X

Aug 08, 2009

Another in the series of “Oh, I’d better write this down here so I don’t forget it in the future” posts. This time, the gems needed to setup AutoTest for a rails app on Leopard

sudo gem install ZenTest   
 
sudo gem install autotest-fsevent 
 
sudo gem install autotest-rails  
 
sudo gem install redgreen

Then you need to create a “.autotest” file with the following:

require 'autotest/fsevent'
require 'redgreen/autotest'

Then it’s just a case of typing “autotest” in RAILS_ROOT.

Simple.

Relationships with Random Strangers

Jun 02, 2009

While it’s difficult coming up with a term for the relationships that we have with people that we interact with online, but not in “meatspace”, it’s harder still coming up with how to describe your relationship with people that A) you’ve never met, and B) you’ve never really even interacted with.

Around a year or so ago, someone posted a link to this photo on Flickr:

duty

Uploaded by Godiex { … } on 20 Dec 06, 1.20PM WST.

Certainly an interesting photo, and one that deserved further investigation. So, I started looking at Godiex’s photostream, and noticed there were a few photos of this girl, who turned out to be his girlfriend. I found her photostream, and then saw this photo

home town

Uploaded by randompanda on 6 Jun 05, 10.41AM WST.

which is a shot of the hill I grew up on (our old house is just around the corner). I thought that was pretty intriguing, and so I added both randompanda and Godiex as contacts.

It turns out that Godiex is an artist from Argentina, and that he and randompanda began a long distance relationship in the comments on a photo on flickr. So, all of a sudden, I’m watching the relationship of two people I don’t know, who met through a photo sharing site. Their photos showed them being apart, randompanda going to live in Buenos Aires, and then the pain of separation when randompanda had to return back to Australia (I presume caused by visa-expiry). I’m guessing I felt an affinity for their situation, as Caren and I spent 10 months of our first 2 years together in different countries.

Through my virtual stalking, it appeared to me that they were waiting for the opportunity to be back together and that all would be well again. Then Godiex posted this photo:

this moon is over

Uploaded by Godiex { … } on 28 May 09, 5.10PM WST.

In the description for the photo he basically said that their relationship was over, effectively being ended by the distance apart. It was weird. Here were two people that I had never met, and only shared the random fact that I grew up in the same town as one of them, and I followed their relationship through the photos they posted. And I was sad that they had made the decision to break up. And it’s clear from the comments on the last photo that there’s a large number of other people feeling the same way.

Well, I hope that these people are still together at least (read the comments on that photo for an amazing story).