Convert array to hash of hashes...

I wanted to convert a array of [item1, item2, item3] to {item1 => {item2 => item3}}. Here is the quick and dirty code I came up with…

   ruby, code

Reboot with Hugo

Thanks to the magic of static site generators, I’ve now moved from Blogger to Hugo. All static site generators are much for muchness, but Hugo appealed to me with the chance of at least hacking in Go. The main benefit though would be archive all my writing in git - which can now be found at https://github.com/kuahyeow/kuahyeow-blog The code to generate my blog is kept in a separate repository. Besides the folders to drive Hugo, I have included a home-made Blogger to Hugo importer.

   blog, technology

Land and Waste New Zealand - #mixandmashnz

Here’s a behind the scenes write-up for my Mix and Mash NZ mashup. Check it out here : http://www.landandwaste.co.nz This mashup attempts to show land and waste data as it changes, and hopefully illuminates any improvements of our environmental impact as well as regressions. The journey It started out as an idea to gather all kerb recycling data from all 75 odd local councils in New Zealand. That meant scraping the data off the websites of various local and unitary councils.

Fix home/end keybindings in Terminal.app on OS X

http://www.yaroze.org/?p=79Go all the way to the end of the less buffer! Drove me crazy the way end behaves exactly like page down instead. This tip fixed that for me. See this Amp at http://amplify.com/u/abkv

Untitled

Amplify’d from martinfowler.comIdentity MapEnsures that each object gets loaded only once by keeping every loaded object in a map. Looks up objects using the map when referring to them.An old proverb says that a man with two watches never knows what time it is. If two watches are confusing, you can get in an even bigger mess with loading objects from a database. If you aren’t careful you can load the data from the same database record into two

Facebook - greedy defaults and jarring configs

Commited Facebook Suicide for the second time. Where do I start? … The first thing that jarred me was that my full birthday is published. This in combination with search engine visibility means that it’s spammer time. Next thing that happened is that the privacy settings had “Everyone”, “Friends of Friends”, and “Friends”. Nice and simple, I thought. But no, I have to exclude my full birthday again from everyone. (I know about how your friend’s applications can just mine everyone’s data through friends).

Bash hackery to get around old rspec

I have a problem where a project is using an older version of RSpec (currently the lastest version is RSpec 1.3.0). Therefore running spec spec/model/some_model_spec.rbgives me an error /spec/models/../spec_helper.rb:23: undefined method `use_transactional_fixtures=’The solution would be to use the older, vendored spec. Now, the spec binary that is installed as part of the gem installation should do this (some gems do checked for vendor’ed binaries) and my rspec is installed under vendor/plugins, not vendor/gems.

   technology, rspec, rails, scripting, bash

How to upgrade to Firefox 3.6 for Karmic (Ubuntu 9.10) - firefox-stable

There are a plethora of install instructions out there for Firefox 3.6 Karmic (which uses Firefox 3.5 by default), however it mostly suggests the mozilla-daily build. By chance, I found the firefox-stable ppa (https://launchpad.net/~mozillateam/+archive/firefox-stable/)Here’s how (enter each in turn):sudo add-apt-repository ppa:mozillateam/firefox-stablesudo apt-get updatesudo apt-get upgradesudo apt-get dist-upgradeHere’s what it looks like:~ $ sudo apt-get upgradeReading package lists… DoneBuilding dependency tree       Reading state information… DoneThe following packages have been kept back:  firefox firefox-3.

   ubuntu, karmic, firefox3