Skip to content

Instantly share code, notes, and snippets.


Dan Callahan callahad

View GitHub Profile

Keybase proof

I hereby claim:

  • I am callahad on github.
  • I am callahad ( on keybase.
  • I have a public key whose fingerprint is 45A9 53A2 E442 7B8A 68D1 7CED 6E4A 6E96 560C 0D96

To claim this, I am signing this object:

callahad / 0 -
Last active Aug 12, 2016
ES7 Async to ES6 via Babel
View 0 -

These snippets show several different ways of accomplishing the same asynchronous task: fetching a document and reporting the status code.

  1. Using callbacks.
  2. Using ES2015 Promises directly.
  3. Using ES7 Async/Await, which is just syntactic sugar for Promises.

The third example is the future, and will likely start landing in runtimes soon. You can use it today thanks to Babel, as snippets #4 and #5 show.

callahad /
Last active Aug 29, 2015
Slides from Software Freedom Day 2015

%title: Intro to FxOS Tooling %author: %date: 2014-09-20

$ cowsay "Intro to FxOS Tooling"

     < Intro to FxOS Tooling >
             \   ^__^
callahad / Dockerfile
Last active Jun 4, 2018
Preliminary Firefox Sync Dockerfile
View Dockerfile
FROM debian:7.4
MAINTAINER Dan Callahan <>
RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
vim curl locales \
&& apt-get clean
RUN locale-gen C.UTF-8 && LANG=C.UTF-8 /usr/sbin/update-locale
callahad / gist:9996308
Created Apr 5, 2014
Links from my talk on Web Components at Twin Cities Code Camp, Spring 2014
View gist:9996308

Don't <blink>: How Web Components will Redefine the Web


  • Firefox (about:config)
    • dom.webcomponents.enabled
  • Chrome (chrome://flags)
    • #enable-experimental-web-platform-features
    • #enable-html-imports

(Firefox doesn't have native HTML import support, yet.)

callahad /
Created Nov 26, 2013
Authority discovery draft.

Authority Discovery

To discover the authoritative Identity Provider for a given email address:

  1. Extract the domain name from the email address and remember this as the Original Domain.

  2. Using HTTPS, attempt to GET /.well-known/browserid from the Original Domain.

  3. Depending on the response:

callahad /
Created Nov 25, 2013
Proposed Goldilocks API spec

Relying Party (RP) API parameters )

Configure BrowserID by registering callbacks and setting display options.

Implementation Notes:
callahad / goldilocks-api.js
Created Oct 3, 2013
Prototype of the proposed "Goldilocks API" for Persona.
View goldilocks-api.js
(function () {
/* License: MPL 2.0.
* This polyfill implements the proposed "Goldilocks API" for Persona atop the
* existing "Observer API."
* Usage:
* 1. Configure Persona:
callahad / lctdjs-persona.js
Last active Dec 23, 2015
Let's Code Test Driven JavaScript's Persona integration.
View lctdjs-persona.js
// Copyright (c) 2012-2013 Titanium I.T. LLC. All rights reserved.
/*global window, document, navigator, XMLHttpRequest, alert, setupPersona, $*/
(function() {
"use strict";
var ready = false;
window.setupPersona = function(email) {
callahad / disable-session-hints.patch
Created Sep 3, 2013
Disable Persona session hints
View disable-session-hints.patch
From 21d898eb00cbcb1ffcab7d5e0ec01a4e80499ea5 Mon Sep 17 00:00:00 2001
From: Dan Callahan <>
Date: Tue, 3 Sep 2013 16:30:44 -0500
Subject: [PATCH] Hack to ignore Persona session hints
mediagoblin/plugins/persona/static/js/persona.js | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/mediagoblin/plugins/persona/static/js/persona.js b/mediagoblin/plugins/persona/static/js/persona.js
You can’t perform that action at this time.