Firefox Sync server on Google App Engine

TL;DR: I built an implementation of the Firefox Sync server API for Google App Engine.

To celebrate Independence Day, I figured I might take a shot at liberating Firefox Sync from the tyranny of Mozilla’s servers.

Thus, over the past few days, I’ve built a sync server using the 1.0 Sync API, hosted on Google App Engine.

I lied about the tyranny thing, though—I just wanted to say something clever about the holiday. In reality, with respect to Firefox Sync, Mozilla has done all of the following:

  1. Published the Sync API spec;
  2. Released the source code for the server used in-house;
  3. Explicitly included the option to use a custom server when setting up sync in the browser.

This means that, although Mozilla offers servers to go along with Firefox Sync, you’re totally free to take your data elsewhere. Since your sync data is encrypted and practically opaque to the server, there’s no direct profit for Mozilla in offering free sync hosting—not even through any clandestine data mining for devious purposes. It’s just that sync makes Firefox a better browser, and somebody has to run some servers to make it work.

So, there’s every incentive to make it easy for you to switch sync providers and stop freeloading on Mozilla’s servers. Building a server on Google App Engine means I can freeload on Google’s servers!

I kid, of course. No one’s really complaining about freeloaders, and App Engine has quotas in place to head off any serious mooching—which is why I’m not telling you where to find my sync server deployed on Google App Engine, by the way.

No, I did this because:

  • Firefox Sync and Google App Engine are interesting and important technologies;
  • I’ve already done a bit of work on the PHP-based Firefox Sync server at Mozilla;
  • I really wanted to take a break from PHP and spend some time with my old friend Python.

There are, of course, a number of bugs in this server. But, it seems to be working between a number of machines and browser profiles I have at home. Things are really in need of optimization, it suffers from my inexperience with App Engine, and I keep running into those aforementioned App Engine resource limits—especially when updating or deleting large numbers of items (ie. 1000′s to 10000′s of items).

Pull requests and issue reports on GitHub are welcome!

A next step I’d like to take with this thing is to revisit another old friend, the desktop web app server. (Also known as the desktop website.) It seems to me that it would be interesting to scale this server down to a household appliance—say, just for use by my wife and I.

I’d be especially happy if the work I’m doing for a Google-hosted app could be self-hosted at home. Seeing as the development environment for App Engine runs on my laptop, I’m willing to bet I can hack the whole shebang into a simple, special-purpose app to download and double-click on a home desktop PC for use as your sync hub.

Anyway, check it out and let me know what you think.

Case Study: Building a Bookmark Management UI for Mozilla’s BYOB

TL;DR: I just wrote a long case-study about my process in building a bookmark management feature for Mozilla’s Build Your Own Browser web application.

So, remember that tutorial I wrote about writing an article in Tinderbox? I’d mentioned that it was a digression from another, different article.

Well, I just finished a first draft of that article:

It’s a case study about building a bookmark management feature for Mozilla’s BYOB.

Light on code but heavy on narration, it’s about what I did and what I was thinking while I did it. There are links to the end product for reference, but it isn’t a demonstration of some new trick. Rather, it’s a look at my process as a whole.

I wrote this, in part, for myself: The writing has helped me review things. But, I’m hoping someone else reads it, and then picks up something new or can offer some interesting critique in return.

And, because I’m curious and like looking behind the scenes, I’d love to see this kind of write-up from more webdevs. There don’t seem to be a lot of detailed case studies versus quick one-shot tutorials on isolated techniques. It’s probably because the writing is time-consuming, as is the reading. It’s not in the genre of bite-sized attractions optimized for promoting blog traffic, but I’d like to see more of them all the same.

Using Tinderbox to write articles for the web

TL;DR: I just put together a tutorial about writing an article in HTML using Tinderbox from Eastgate Systems, Inc.

Update: There’s a Belorussian translation of this post provided by PC – very cool!

tinderboxicon

Tinderbox Icon by Bryan Bell, via flickr.com/photos/factoryjoe

I’ve been toying with a set of writing topics to get my blog going again, apropos of my notion of writing for myself. But, I like to write at length and have finally decided that life’s too short to write in browser <textarea>‘s, no matter how cleverly augmented.

I did buy MarsEdit 3, which is a fine app for dashing off short entries. But, for longer things, I found myself doing the actual writing elsewhere and pasting the text into MarsEdit for posting later. I even wrote and posted a whole fanfic novella this way, and it was a silly way to do things.

Well, one of the places where writing actually happens for me over the past few years is within Tinderbox documents. And, as it turns out, Tinderbox has some powerful HTML export facilities that I’ve left underused until some things finally clicked for me.

So, I thought I’d try turning that experience back upon itself to produce something worth writing. Without further ado, here’s the source in GitHub, and the article exported to HTML for easy reading.

The funny thing is, I started working on this tutorial in the middle of writing another article. So, this post is a particularly advanced form of Yak Shaving. I hope it ends up handy for someone, and I hope it leads to the real articles I’m hoping to produce.

Reviving my C64 history with a uIEC/SD

I’ve lived a very focused life. From very early on, I’ve been learning to make computers do things.

And being as introspective as I am, I like spending time considering how I got here. I suppose this is nostalgia, but I like to think of it as recentering and recapitulation. Contemplating the story so far, as a means to consider the story yet to come.

One huge benefit of this habit is that I’ve become ever more appreciative of today. It’s easy to forget, but we’re living in the future these days—at least, with respect to who I was in 1983.

No flying cars yet, but for US$55 I was able to buy a tiny gadget called a uIED/SD that gives a Commodore 64 access to modern SD cards for storage. And, of course, I have Jason Scott’s review of the more general-use FC5025 5.25″ Floppy to USB Adapter to blame in getting me started on this current mini-obsession.

You want to talk about a magical device? Screw the iPad—this is magic.

This is what it looks like:

Read More »

Mass Effect 2: A Review

I just finished Bioware’s Mass Effect 2 for Xbox 360, and I’ve got some thoughts about it. Haven’t really written reviews here for games before, but I said I wanted to start posting things here that I’d want to read. So, here goes…

In a nutshell: I loved it, will play it again—but it could have been so much better.

Read More »

Pondering the cobwebs

It’s plain to see that I’ve not been a blogger for a long time.

This place is a long-neglected ghost town that sees a begrudged entry every few months, when I happen to remember it still exists and I feel guilty for not feeding it with content. What I’ve yet to figure out is if the cause is a matter of motivation, publishing tools, audience, or writing topics.

Behold as I ramble on for many tens of words pondering the cobwebs here at 0xDECAFBAD.

Read More »

Professional JavaScript Frameworks is a real book!

Introducing Professional JavaScript Frameworks, my first multi-author book project and the result of almost 2 years’ writing, editing, revising, and cat herding. The author roster changed a few times in the process, as did the editorial oversight, but finally the thing’s hitting shelves.

This one’s been a long time coming, but it’s finally sitting in my grubby little hands:

My contribution to this book includes all of the material from The Concise Guide to Dojo, plus a second concise guide worth of material on the MooTools JS framework. In addition to my work, you can find the work of Ara Pehlivanian on YUI, Scott Koon on Prototype, and Harley Jones on ExtJS.

HTML5 drag and drop in Firefox 3.5

Oh hey, look! It’s another blog post—and this one is cross-posted on hacks.mozilla.com. I won’t say this is the start of a renewed blogging habit, but let’s see what happens.

Drag and drop is one of the most fundamental interactions afforded by graphical user interfaces. In one gesture, it allows users to pair the selection of an object with the execution of an action, often including a second object in the operation. It’s a simple yet powerful UI concept used to support copying, list reordering, deletion (ala the Trash / Recycle Bin), and even the creation of link relationships.

Since it’s so fundamental, offering drag and drop in web applications has been a no-brainer ever since browsers first offered mouse events in DHTML. But, although mousedown, mousemove, and mouseup made it possible, the implementation has been limited to the bounds of the browser window. Additionally, since these events refer only to the object being dragged, there’s a challenge to find the subject of the drop when the interaction is completed.

Of course, that doesn’t prevent most modern JavaScript frameworks from abstracting away most of the problems and throwing in some flourishes while they’re at it. But, wouldn’t it be nice if browsers offered first-class support for drag and drop, and maybe even extended it beyond the window sandbox?

As it turns out, this very wish is answered by the HTML 5 specification section on new drag-and-drop events, and Firefox 3.5 includes an implementation of those events.

If you want to jump straight to the code, I’ve put together some simple demos of the new events.

I’ve even scratched an itch of my own and built the beginnings of an outline editor, where every draggable element is also a drop target—of which there could be dozens to hundreds in a complex document, something that gave me some minor hair-tearing moments in the past while trying to make do with plain old mouse events.

And, all the above can be downloaded or cloned from a GitHub repository I’ve created especially for this article—which continues after the jump.

Read More »