Loose Bits Thoughts on distributed systems, cloud computing, and the intersection of law and technology.

Async.js Presentation for Joint Node.DC / DC jQuery Meetup

Async.js, a JavaScript Control Flow Library

On February 20, 2012, I gave a talk on Async.js to the joint meetup of Node.DC and DC jQuery.

Async.js is a control flow library that provides great abstractions for writing serial, parallel, and combined asynchronous code without ending up in the dreaded trenches of nested callback insanity.

![Async.js presentation][img_pres] [img_pres]: http://loose-bits.com/media/img/2012/02/21/async-talk.png

My presentation is available live on GitHub, and uses Impress.js for Prezi-like functionality in the browser. As a consequence, it might not render in older browsers and IE. My talk covers the basic abstractions:

  • Series
  • Waterfalls
  • Parallel
  • Collections

and more, so check it out and feel free to ping me with any questions or comments!

Read more...

Authenticated, Static Web Sites on Google App Engine

Static HTML Web Site Hosting with Google App Engine

Google App Engine is a platform-as-a-service (PAAS) product that provides scalable, cloud-hosted web applications using Google’s massive engineering infrastructure. While App Engine is primarily used by web developers (e.g., programming in Python or Java), it offers three features which make it uniquely helpful for static site hosting:

  • Arbitrary static file handling.
  • Extensible authentication support.
  • Very inexpensive (most likely free) for hosting static content.

In this post, we’ll walk through uploading a static HTML site to App Engine, and configuring it such that it requires users to log in to via a Google Apps domain account before viewing any content. This is a common situation for organizations already using Google Apps to manage email, documents, etc. that want to host a web site without having extra configuration hassles. App Engine essentially takes care of all the authentication / user management, and you just have to upload the static web site.

The assumption throughout the rest of this post is that you already have a domain name managed by Google Apps (e.g., “example.com”). We will create an App Engine application and restrict it to users of the specific Google Apps domain, requiring a login of a user “@example.com”. Then we’ll upload the static site and verify that authentication works as expected.

Read more...

Twitter Bootstrap Theme for Sphinx

Bringing Twitter Bootstrap to Sphinx

Bootstrap is an open source CSS/JS framework from the folks at Twitter that provides base typography, layout (grids), forms / form inputs, tables and navigation, and has been gaining wide popularity among developers. In my personal experience with a couple of sites and projects, Bootstrap really provides a great starting point for a frontend that provides good extensibility over time.

Sphinx is the most popular Python documentation generator tool. It has fantastic Python module docstring / comment parsing in addition to a sensible static pages framework, providing a great final web site built from both inline code documentation and outside web pages.

In the process of starting up a number of new Sphinx projects, I decided that I would really like to use Bootstrap as the underlying UI framework. Fortunately, Sphinx supports custom theme plugins, so I spent a couple of days hacking, and created a Sphinx Bootstrap Theme, which is now available on GitHub.

To show all of the coolness of Bootstrap and Sphinx, I’ve put up a simple demo, which provides a skeleton Sphinx site with the project README file rendered as content. Here is a screenshot:

[![Sphinx Bootstrap Theme Demo][img_sbt_teaser_th]][img_sbt_teaser] [img_sbt_teaser_th]: http://loose-bits.com/media/img/2011/12/09/sbt_teaser_thumb.png [img_sbt_teaser]: http://loose-bits.com/media/img/2011/12/09/sbt_teaser.png

Read more...