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.com Identity Map Ensures 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.

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. Therefore, I use some bash trickery to dynamically redefine the “spec” command. Put the code below in .bashrc : vendored_or_path_spec() { if [ -x vendor/plugins/rspec/bin/spec ]; then echo ‘vendor/plugins/rspec/bin/spec’; else echo ‘*spec’; fi } alias spec=’$(vendored_or_path_spec) $@’ Some explanations. The hardest thing to figure out was how to dynamically alias something. After such scrumbling and asking on vark.com, I managed to find command substitutions, which is the $(command) part. Combining that with $@ for all arguments meant that I can run any command in the alias. Because I’m aliasing spec, I use *spec to refer to the original un-aliased spec. That’s it!

   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.5 firefox-3.5-branding firefox-gnome-support0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.~ $ sudo apt-get dist-upgradeReading package lists… DoneBuilding dependency tree Reading state information… DoneCalculating upgrade… DoneThe following NEW packages will be installed: firefox-brandingThe following packages will be upgraded: firefox firefox-3.5 firefox-3.5-branding firefox-gnome-support4 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.Need to get 12.5MB of archives.After this operation, 32.4MB of additional disk space will be used.Do you want to continue [Y/n]? yYou will now get /usr/binfirefox as Firefox 3.6

   ubuntu, karmic, firefox3

Rails 3 presentation

At the January WellRailed (Wellington Rails User group), I gave a presentation on the upcoming Rails 3.0, with special emphasis on cool new things. You can view the slides after the jump. There are a huge number of changes, but it should be all good fun :) Rails 3 : Cool New Things by Thong Kuah View more presentations from Y. Thong Kuah. Note: Rails 3.0pre was released after the presentation

   technology, programming, rails3

Nuggets of inspiration

Some good Software Engineering pearls of wisdom : Coding Horror: The Xanadu Dream The bottom line is that a lot of the time it’s OK to create a solution that solves 80% of the problem. Always remember that shipping is a feature. Agile development, startups and government policy My recommendation to just about anyone with an idea is to just build the thing, iterate until you have some user traction, then pitch angel investors based on that traction. This is very much in line with the old IETF motto of “rough consensus, running code." And from the startup side of things: Finding Your Co-Founders It’s most comfortable to hang out with people like ourselves, but those are exactly the folks you probably don’t want to co-found a startup with. …The best founding team for a startup is a group of two or three people who have synergistic – not overlapping – skills. Note that it’s also important your goals and passions be similar. This matches well to what the Black Swan book says - maximise your serendipity, you increase your chances of success this way

   technology, life, business, wisdom, inspiration, lessons learnt

Wellington Hazard Map

Reading this article about Wellington Hazards just makes me want to plot it on a map. It took a while, but here is a map of Wellington Hazards / Contamination. Below is a screenshots of the hazards on Google Earth and Google Maps (Google Earth shot nicely prepared by Cameron). Let me know what do you think? Read on after the jump for hyper-technical explanation of how I made the map. Here’s the lowdown on the technical wizardry. The data is based on http://static.stuff.co.nz/files/WCC-slur.pdf. I had to extract the data out from the pdf, obtaining a spreadsheet that looks like this: No & STREET & City HAIL & CLASSIFICATION& CONTAMINANTS 50 BUCKLE ST EASTERN Service Stations Verified History of Hazardous Activity or Industry 75 DARLINGTON RD EASTERN Landfill Verified History of Hazardous Activity or Industry 501 EVANS BAY PDE EASTERN Service Stations Verified History of Hazardous Activity or Industry 9 -11 KENT TCE EASTERN Storage Verified History of Hazardous Activity or Industry The address leaves a lot to be desired. Having data like ‘Eastern’ for the city column makes no sense to anyone or a program. Cleaning that up and adding “Wellington NZ” would make it easier for geocoding. We now have this: HAIL & CLASSIFICATION& CONTAMINANTS Full Cleaned AddressService Stations Verified History of Hazardous Activity or Industry 50 BUCKLE ST Wellington New ZealandLandfill Verified History of Hazardous Activity or Industry 75 DARLINGTON RD Wellington New ZealandService Stations Verified History of Hazardous Activity or Industry 501 EVANS BAY PDE Wellington New ZealandStorage Verified History of Hazardous Activity or Industry 9 -11 KENT TCE Wellington New Zealand We can now geocode, using the helpful spreadsheet geocoder (instructions here). The only limitation was that only 100 addresses can be geo-coded at one time. But that’s fine as I only have 592 addresses. Now here is the tricky bit, there is no good way to get items from a spreadsheet onto a map. The best way I could was use KML. I used the Spreadsheet Mapper v2.0, but it was far too painful with the browser locking with just 600 rows. Here is the resultant spreadsheet: http://spreadsheets.google.com/pub?key=tXlYA3d_eh42qOboocs8zug&output=html. I will most likely use PostGis and the asKML function next time. Data spreadsheet: http://spreadsheets.google.com/pub?key=t_4WKBgw34UvW_zQMChuVKw&gid=0 Google Maps (my maps): http://maps.google.co.nz/maps/ms?ie=UTF8&hl=en&msa=0&msid=105368590499327803003.000475dc20f9a8d9d5142&t=h&z=11 KML file (.kml): http://maps.google.co.nz/maps/ms?ie=UTF8&hl=en&t=h&msa=0&output=nl&msid=105368590499327803003.000475dc20f9a8d9d5142

   hazard, wellington, map, gadget, opengovt

Rands In Repose: Your People

Came upon this really good post about people you should cherish: Rands In Repose: Your People Really good insight - “As we edit our days into these stories, there is always a risk of fiction. This is why you need to identify and nurture Your People." What are Your People? “You tell these stories to Your People without reservation. Your People love your stories — fiction and all. They love how you tell them, they laugh about the lies you tell yourself, and then they stop and they tell you the truth.” You need someone to keep you honest. Read the post for a clear definition of Your People.

   friends, people, rands, life, lessons learnt