Category: Development

code
2

Mock geolocation

Useful if you’re working on a website meant for mobile devices. Firefox 3.5 has geolocation, but I use this with Safari and GreaseKit. Replace with whatever latitude and longitude you prefer, naturally.

if (!('geolocation' in navigator)) {
  navigator.geolocation = {
    watchPosition: function(success, f, options) {
      var broadcast = function() {
        var position = {
          coords: {
            latitude: 30.2696384,
            longitude: -97.74947,
            accuracy: 10000,
          },
          timestamp: (new Date()).valueOf()
        };        
        success(position);
      };
      
      broadcast();
      window.setInterval(broadcast, 10000);
    }
  };
}
link
1

A stream‐of‐consciousness browsing session brought me to this writeup on how the Source engine deals with lag. Also serves as a parable for web developers — don’t rely on the client to validate input, for the same reason that a game server can’t trust a participant to tell it if that bullet hit anything. See also Ninjam, a clever latency workaround for online jam sessions. And consider that even without the inherent delays of Internet traffic, the speed of light would be a constraint on distant collaboration.

link

Thomas Fuchs just pushed out the alpha 5 release of scripty2. This is the first release to include the small handful of UI controls I’ve been writing. The controls are designed to be compatible with jQuery UI’s Theme API — meaning that, for instance, a theme built with ThemeRoller could be dropped into a site using scripty2, and vice‐versa. More to come!

The “Configurable” pattern

Posted in Articles, Prototype

If you don’t know about Raphaël, you’d better ask somebody. It provides a vector drawing API that works in all major browsers (by abstracting between SVG and VML). I’ve been working on a JavaScript charting library called Krang. Krang is designed to take a data set and produce any chart

Read more →

Panel audio from The Ajax Experience

Posted in Prototype

I just discovered the existence of audio (and slides) for two of the sessions I was involved with at The Ajax Experience 2008, held in Boston last September. Which is to say: I knew that audio existed, but didn’t know it was yet available anywhere. The first was PPK’s main‐hall

Read more →
link
1

Yesterday, Sunlight Labs announced Apps for America 2. The follow‐up contest marks the recent launch of data.gov
by soliciting apps that find interesting ways to crunch that site’s numbers. (Not sure if I’ll enter yet; I haven’t had much time to see what data.gov has to offer.)

link
13

Dean Edwards explains how the standard “callback” pattern in JavaScript is too brittle for something like a “DOM ready” event. Prototype appears to be the one major library that handles this “correctly.” WIN!

link

That SXSW panel I was on the other day (I am, um, awful at self‐promotion, even on my own blog) has already been released via podcast, to my own astonishment. John Resig‘s got the slides, so as soon as he posts them I’m sure we’ll find a way to synchronize them to this audio.