Archive for January, 2010

Calculating Chrome Extension ID from your private key

posted January 19th, 2010, no comments, tagged

Chrome Extensions files (those with the .crx extension) are, in essence, signed ZIP files. The extension data is signed with your private key, while the public key is included in the .crx. A hash of this public key is used as the extension identifier when you install the extension. This identifier is important because you [...]

Continue reading on Supercollider.

Computed Style Differences for `clip:rect()`

posted January 14th, 2010, no comments, tagged

Computed style values for clip:rect() are different in WebKit compared to Gecko and Opera. Given this test code: <div id="test" style="clip:rect(0, 50px, 50px, 0);width:100px;height:100px;position:absolute;background:red"></div> <script> window.onload = function(){ alert(window.getComputedStyle(document.getElementById("test"), null).clip); }; </script> You get: WebKit: rect(0px 50px 50px 0px) Opera: rect(0px, 50px, 50px, 0px) Gecko: rect(0px, 50px, 50px, 0px) Nothing I couldn’t fix in the regular expression I was using to split the values, [...]

Continue reading on Supercollider.

Peblingesø

posted January 13th, 2010, no comments, tagged

It’s been freezing in Copenhagen so last Sunday I went out to the lakes and took the opportunity to walk across them.

It had been a while since I stood on proper ice!

posted January 13th, 2010, no comments

Competition is a figment of the spectator.

—Shaun Inman

In my view it tends to be a figment of the spectating journalist.

Complainocracy

posted January 13th, 2010, no comments

What we live in at the moment is a complainocracy, where every two years if our leaders have disappointed us we can replace them with leaders who have yet to disappoint us.

Raj Patel on The Colbert Report (at 5:43).

Blu Dot Real Good Experiment

posted January 10th, 2010, no comments, tagged

Design studio Blue Dot put a few of their chairs on the streets of New York and tracked the people who picked them up back to their apartments through GPS. A lovely concept and a lovely video:

Blu Dot Real Good Experiment from Real Good Chair on Vimeo.

Via Matt Cottam of Tellart, the folks who made the tech.

Bootstrapping Dojo in Node

posted January 10th, 2010, no comments, tagged

Being a Dojo hacker I’ve been wanting to use Dojo in combination with Node for a while now. So on a recent flight to London I added support for the Node environment to Dojo. I cleaned it up yesterday and – after figuring out Git – the code is now available on my Dojo fork. Dojo [...]

Continue reading on Supercollider.

Good OpEd piece by Jasper Teulings of Greenpeace on the treatment of four activists who crashed an official banquet during the COP15 talks.

Before her arrest, Nora told an interviewer that she was aware of the possible consequences of what she intended to do but Nora assumed, as did we all, that in Denmark the law would play by the law. She would be arrested, charged, released until trial and then, if convicted, perhaps sentenced to a fine or some time in jail.

Nora, charged but not convicted, was held for twenty days in a prison cell. For most of this time she was permitted to receive no letters, books or family visits. From arrest through Christmas and New Year she had no contact with her husband and two young children.

(…)

After the arrest, Greenpeace guaranteed that, if the activists were released, they would voluntarily return to Copenhagen to stand trial. To further facilitate the police investigation, Greenpeace immediately offered its full co-operation to Danish police and provided them with comprehensive details of the activity. A request from Greenpeace asking the Danish police to specify what additional information they required in order to complete their investigation was met with two weeks of silence. While the police claimed their detention was necessary for the investigation, it turns out that the Four were only questioned briefly on their first day in custody and for 15 minutes shortly before their release.

Danish police has acted questionably during COP15, and seeing how this protest has been handled isn’t very encouraging. Restricting peaceful protest is bad for democracy, and unfortunately Denmark has become somewhat more restrictive over the past few months.

Redirecting your OpenID

posted January 4th, 2010, no comments, tagged

Previously, my OpenID login was under http://novemberborn.net/recent. But, with last week’s site update, I’ve added a landing page under http://novemberborn.net and am redirecting /recent to /latest. Albeit an improved setup, this has broken my OpenID logins to various websites which are expecting the login to be http://novemberborn.net/recent.

As it turns out, OpenID follows redirects, so even if I try to login with the /recent URL, the OpenID client is redirected to /latest which does not carry any OpenID information. Some Googling turned up a post from Will Norris entitled Challenges in changing my OpenID. He describes a few heuristics for detecting whether an HTTP request is an OpenID request:

  • The Accept header contains application/xrds+xml.
  • The user agent is identified as openid.
  • The user agent is an empty string, or the User-Agent header is not specified at all.

With these heuristics we can create a simple openid-redirect.php script that will redirect to /latest unless it’s dealing with an OpenID request, in which case it serves up a small HTML document carrying my OpenID information:

<?php
if(stripos($_SERVER["HTTP_ACCEPT"], "application/xrds+xml") !== FALSE ||
  stripos($_SERVER["HTTP_USER_AGENT"], "openid") !== FALSE ||
  empty($_SERVER["HTTP_USER_AGENT"])
){
  header("Content-type: text/html");
  echo '<html><head><link rel="openid.server" href="http://id.11born.net"><link rel="openid2.provider" href="http://id.11born.net"></head></html>';
}else{
  header("Location: /latest", TRUE, 301);
}
?>

Combine it with a simple mod_rewrite rule and we’re all set:

RewriteRule ^recent$ openid-redirect.php [L]

A quick test with curl to confirm everything is working:

mark$ curl -H "Accept: application/xrds+xml" -v novemberborn.net/recent
* About to connect() to novemberborn.net port 80 (#0)
*   Trying 8.17.171.168... connected
* Connected to novemberborn.net (8.17.171.168) port 80 (#0)
> GET /recent HTTP/1.1
> User-Agent: curl/7.19.6 (i386-apple-darwin10.0.0) libcurl/7.19.6 OpenSSL/0.9.8k zlib/1.2.3
> Host: novemberborn.net
> Accept: application/xrds+xml
> 
< HTTP/1.1 200 OK
< Date: Mon, 04 Jan 2010 22:22:17 GMT
< Server: Apache
< Served-By: Joyent
< Vary: Accept-Encoding
< Connection: close
< Transfer-Encoding: chunked
< Content-Type: text/html;charset=UTF-8
< 
* Closing connection #0
<html><head><link rel="openid.server" href="http://id.11born.net"><link rel="openid2.provider" href="http://id.11born.net"></head></html>

Now I can still use http://novemberborn.net/recent as my OpenID login, although I’m moving the various websites I use OpenID with to just http://novemberborn.net.

Building Installations in Five Days (and a bit)

posted January 4th, 2010, no comments, tagged

Last month I travelled to Stockholm to give a lecture at Södertörn University. Entitled Building Installations in Five Days (and a bit) it discussed the main takeaways from the Hacker camps run by Mediamatic at PICNIC: Simplify, simplify, simplify, because there’s only five days and because it’s about the real value of the experience. Constraints are freeing, [...]

Continue reading on Supercollider.

Optimizing HTML

posted January 3rd, 2010, no comments, tagged

Via Paul Irish a bunch of tips on optimizing your HTML structure. From the obvious in unobtrusive coding (no onclick="…" attributes) to not specifying method="get" on form elements, 22 tips on optimizing your site’s HTML. Perfection kills » Optimizing HTML.

Continue reading on Supercollider.