Stefan Goodchild

Processing SASS from more than one location

I’m currently working on the front end of a RoR site using the wondrous HAML & SASS and had a requirement to process SASS files from more than one directory and deposit them into public/stylesheets. Thanks to Jamie here at Jiva we have found that buried in the code is support for that very thing.

Simply put the following code at the bottom of your environment.rb and SASS will munch away happily.

Sass::Plugin.options[:template_location] = {
   RAILS_ROOT + '/your/base/directory' => RAILS_ROOT + '/public/stylesheets',
   RAILS_ROOT + '/you/theme/directory' => RAILS_ROOT + '/public/stylesheets'
}

Ruby On Rails - Missing Link?

I’ve finally been kicked up the arse and started to learn Ruby On Rails in anger and finding it really refreshing but fustrating in equal measure. Refreshing because there is so much just taken care of for you in terms of programming, but fustrating because it’s a total mind shift in terms of fitting in with the framework and researching existing solutions instead of solving the problems myself.

Looking around there are an amazing amount of “Getting Started” tutorials but not much more really. There is a huge chasm between these (usually very simple) tutorials and the documentation for Gems such as Clearance. There are a few excellent screencasts that have helped from Peepcode but somehow I always feel like they are aimed too low or too high for someone who learns like I do.

So how does one bridge that gap? I’ve looked at books - and there are loads of great RoR tomes - but my brain just doesn’t absorb information in that way, I have to actually be doing something - for real - for it to sink in for some reason. Personally I’ve taken to wandering around GitHub and downloading templates and other project templates and piecing together how it all fits together myself but given how many coding styles exist even in the tightly controlled world of RoR it can create more confusion sometimes.

Find URLs RegEx

Had a need to find various types of links in plain text using javascript and @theozaurus came up with the RegExp goodness after we found the normal online resources lacking a bit. It’s not 100% foolproof but it’ll cover 95% of usual formats we could think of.

(((https?|ftp):\/\/[^\.]|www\.)[^\s]*[^\s\.,])

In Defense Of Eye Candy by Stephen P. Anderson

Researchers in Japan setup two ATMs, “identical in function, the number of buttons, and how they worked.” The only difference was that one machine’s buttons and screens were arranged more attractively than the other. In both Japan and Israel (where this study was repeated) researchers observed that subjects encountered fewer difficulties with the more attractive machine. The attractive machine actually worked better.

So now we’re left with this question: why did the more attractive but otherwise identical ATM perform better?

A List Apart

Limited Run Pierre Schaeffer T-Shirt by Stefan Goodchild

schaeffer_example_brown

New t-shirt design for Analog Industries following the Delia Derbyshire T-shirt in our Eclectronica series. This time the subject is Pierre Schaeffer. Widely regarded as the creator of Music Concrète you can read all about him on his Wikipedia entry.

It’s available to buy online from Analog Industries