Category Archives: programming

Using SCSS with Webby

Written by Richard. Filed under programming. No comments.

To get webby using HAML/SASS’ SCSS rendering engine I added the following to my Sitefile. No doubt there’s a cleaner and quicker way of getting it working, but this works.

  Webby::Filters.register :scss do |input, cursor|
    opts = ::Webby.site.sass_options.merge(cursor.page.sass_options || {})
    opts = ::Webby.site.sass_options.merge(:syntax => :scss)
    opts = opts.symbolize_keys
    opts.merge!(:filename => cursor.page.destination)
    opts[:style] = opts[:style].to_sym if opts.include? :style
    Sass::Engine.new(input, opts).render
  end

Rspec/Cucumber Autotest Loop

Written by Richard. Filed under programming, rails. No comments.

Autotest would constantly run my tests even though I hadn’t modified anything. Which made it impossible to actually use. Creating the following in a file called .autotest in my application’s root solved the problem for me. This is on Rails 3 RC, RSpec 2 beta 19 and Cucumber 0.8.5.

  Autotest.add_hook :initialize do |at|
    at.add_exception(%r{^\./\.git})
    at.add_exception(%r{^\./db})
    at.add_exception(%r{^\./log})
    at.add_exception(%r{^\./tmp})
    at.add_exception(%r{^\./rerun.txt})
    at.add_exception(%r{^\./Gemfile.lock})
  end

Please don’t let yourself go stale

Written by Richard. Filed under programming. No comments.

I’ve written before about the notion of developers going stale. Day in day out I see examples of ydiw, but not of the “You’ve made a mistake, let me fix that for you” nature, but more of the “The 80′s called, they want their program back” type. I can forgive bugs and mistakes, but I just find it very hard to not get annoyed with antiquated and long-winded ways of doing things, especially when there are far better/easier/quicker ways of achieving the same goals with other tools.

Burying your head in the sand about different techniques and technologies does no one any favours, especially yourself. You don’t need to learn each new shiny language in depth or even at all, but just reading a bit about it or even trying it out will propel your game so far ahead of the pack that you’d be foolish not to do it. Now maybe you don’t care, maybe you’re just not interested and that’s fine, it’s not for everyone, but then don’t make others suffer because of your laziness/lack of enthusiasm. I don’t come over to your house and shit in your living room, so please don’t do it in mine.

It just pains me so much when I see things being done wrong. You can call me a fanboi if you want, but I don’t simply bang the drum of the technology I use because I’ve been brainwashed, but because I’ve been where you are now and discovered something better. Now you can always ignore my advice, after you’ve investigated it yourself, but don’t just dismiss it out of hand. So many people make out like it’s such a great sacrifice to try other technologies. But how long would it really take to try something? Not even a few hours. You’re not willing to give up a couple of hours for potentially days and days of re-couped time? Get out of here!

Finally, if not for yourself, do it for your clients. Would you trust a doctor who used methods from the 15th century? No? Then why should your clients trust you if you’re still using crazy old ways to get stuff done.

So let’s make the world a better place and make my life easier at the same time. Right, I’m off to play with HTML5 and CSS3.

It’s the polish that takes the longest

Written by Richard. Filed under programming. No comments.

After spending a few hours in Photoshop trying to get some buttons to just look “right”, I started to think about how I seem to spend the majority of my time adding “polish” to applications. Getting features in is easy, getting them working nicely and looking great is hard. It’s the 80/20 principle, it’s that final 20% that makes the difference between good and great. Apple is the obvious choice of reference here when it comes to polish. Their products are polished to such a high degree, that can’t help but I wonder what percentage of time they spend getting it right over getting it done.

who.removed.me

Written by Richard. Filed under programming. Tagged . No comments.

I had the worst tooth ache last Thursday so couldn’t sleep. So while being up for most of the night I thought I’d whip up a small app to track my Facebook friends using the new Facebook Graph API. I’m always curious to see who has removed me on Facebook, and now I can finally see who has. Check it out here http://who.removed.me