Archive for August, 2011

  Jobs →  August 25

We all know the broad strokes…

John Biggs sums it up in the best piece I’ve read so far. (Hopefully also the last, because my RSS feed over the next month is going to be dominated by What now?, Apple is doomed! and Apple is ok! pieces by “tech analysts”.)

Now if you’ll pardon me, I’m going to watch that commencement video again on one of my Apple devices.

Lovely. Watch with a friend, and play “hey, that’s [place]!”.

  Codecademy →  August 23

Codecademy teaches JavaScript programming through the browser: follow instructions, type in code, move on to the next step. This is similar to the (slightly more amusing) Rails for Zombies.

Browser-based code classes look promising for classroom teachers: there’s no need to install compilers or even text editors, making this environment much easier to set up in a lab. Students can also continue their work easily at home, with (some level of) instant feedback from the built-in help system.

The associated Hacker News post has some interesting suggestions, and the comments from non-programmers about the course’s difficulty can be quite enlightening to anyone trying to teach a programming course.

This article on the (new?) The Sass Way blog describes how you can “pre-stack” parent selectors in Sass. In other words, as you’re working on a selector, you can style a parent selector above it using Sass’s nested syntax.

This is great when styling for IE with Paul Irish / HTML5 Boilerplate’s conditional IE classes — for an element misbehaving in, say, IE7:

.item {
  float: left;
  margin: 1em;
  .ie7 & {
    display: none; // WTF IE SCREW YOUUUU
  }
}

(Marginally related: When looking for a “go away, IE6 users” message for our new GuestDay web app, we came across Microsoft’s IE6 Countdown, which currently pegs Singapore at only 3.1% IE6 usage. Not bad.)

(Yes, this is how we do launch announcements — in a footnote of a marginally related post.)

Just noticed that Middleman, my preferred static site framework, got a major update and its own website. What it is:

  • Ruby gem running off Sinatra
  • Allows templates, partials and creates pretty URLs
  • Lets you use trendy-ass languages like Haml (boo), Sass (yay), CoffeeScript (wha?) and Markdown (all hail Lord Gruber)
  • Supports great tools that have become essentials in my web development workflow: HTML5 Boilerplate, LiveReload, Pow via Rack, and Compass
  • And a bunch of other features I should probably be using. As with the HTML5 Boilerplate, this is a large part of its appeal — discovering new tools and best practices.

First version was a bit iffy here and there, but the developer was very responsive (even after having taken a break from the project). Now super awesome, highly recommended, blah blah.

Makes sense. Stay for the post-credits sequence!

By Moebius and others:

Really love watching these pieces come alive.

Shell script and Alfred extension to toggle proxy in Lion

August 16, 2011  |  Tags: ,   |  

My stupid ISP occasionally (and inconsistently) fails to load some sites unless I’m on their web proxy. As a result, I constantly have to do the network proxy toggling dance on my Mac (System Preferences → Network → Advanced → Proxies → checkbox).

Turns out this can be done with a script. In Lion, though, Apple’s renamed “AirPort” to “Wi-Fi”, so I’ve updated the scripts from the linked post:

  • To enable the proxy, use networksetup -setwebproxystate wi-fi on
  • To disable, use networksetup -setwebproxystate wi-fi off

Here’s a (very fragile) shell script to toggle your proxy, depending on whether it’s on:

#!/bin/bash
 
e=$(networksetup -getwebproxy wi-fi | grep "No")
 
if [ -n "$e" ]; then
  echo "Turning on proxy"
  networksetup -setwebproxystate wi-fi on
else
  echo "Turning off proxy"
  networksetup -setwebproxystate wi-fi off
fi

I’ve also packaged it as an extension for the extraordinarily useful launcher Alfred, so I can just hit cmd-space, type in “proxy”, and it’ll toggle between the two states (with a handy Growl notification telling me what it just did). You can download it here.

Some notes:

  • For all these scripts to work, you must already have the proxy set up in your Network Preferences.
  • I believe these scripts only work on Lion — for Snow Leopard and before, try changing wi-fi to airport. Sorry, I don’t have any machines on 10.6 to test on!
  • The script is fragile because it’ll break the moment Apple changes the output of networksetup. Let me know if this happens, and I’ll try and fix it.

Thanks to a nonsense Java applet, UOB’s Internet Banking service doesn’t work with any browser on Mac OS X Lion, even with the additional Java software update installed. Java! So secure you can’t access your own damn account!

Luckily, one Justin Lee found a way to connect, thanks to an exceptionally half-hearted compatibility fix by UOB: just tell the UOB website that you’re on an iPhone, and it’ll happily let you in without its Java applet “security” goodness.

His suggested method is to use Firefox and download a plugin called User Agent Switcher, but you can also accomplish the same thing by enabling Safari’s Developer menu from its preferences, and choosing Develop → User Agent → Safari iOS.

(I vaguely recall another bank site having the same issue — Citibank? I’ll update this post if the fix works there, too.) [Update, 15 Aug: nope, all the other banks I use — Citibank, DBS and HSBC — work fine.]

No need to link to the original piece, because Craig Grannell has taken it down sentence by loving sentence. Usually, these per-sentence rebuttal pieces are pretty insipid, but Grannell really executes this one in style. Helps, of course, that the source material is self-indulgent bullshit.

There’s a very dangerous sentence in this piece, though:-

There are no good games for the iPhone at all.

The author is being sarcastic, of course, and listing some of the best iPhone games he’s come across. This list includes World of Goo, Strategery, Infinity Blade and Dungeon Raid, which have each cost me hours of productivity, so I’m terrified to click on the other links (Space Invaders Infinity, Real Racing 2, Forget Me Not, and Beyond Ynth).