Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am callahad on github.
  • I am callahad (https://keybase.io/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
callahad / 0 - README.md
Last active August 12, 2016 13:11
ES7 Async to ES6 via Babel

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
callahad / sfd.md
Last active August 29, 2015 14:06
Slides from Software Freedom Day 2015

%title: Intro to FxOS Tooling %author: dcallahan@mozilla.com %date: 2014-09-20

$ cowsay "Intro to FxOS Tooling"

      _______________________
     < Intro to FxOS Tooling >
      -----------------------

\ ^__^

@callahad
callahad / Dockerfile
Last active November 15, 2022 17:57
Preliminary Firefox Sync Dockerfile
FROM debian:7.4
MAINTAINER Dan Callahan <dan.callahan@gmail.com>
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
ENV LANG C.UTF-8
@callahad
callahad / gist:9996308
Created April 5, 2014 18:56
Links from my talk on Web Components at Twin Cities Code Camp, Spring 2014

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

Flags:

  • 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
callahad / discovery.md
Created November 26, 2013 14:58
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
callahad / api-rp.md
Created November 25, 2013 22:49
Proposed Goldilocks API spec

Relying Party (RP) API

navigator.id.watch( parameters )

Configure BrowserID by registering callbacks and setting display options.

Implementation Notes:
@callahad
callahad / goldilocks-api.js
Created October 3, 2013 10:22
Prototype of the proposed "Goldilocks API" for Persona.
(function () {
/* License: MPL 2.0.
*
* This polyfill implements the proposed "Goldilocks API" for Persona atop the
* existing "Observer API."
*
* Usage:
* 1. Configure Persona:
*
* navigator.id.watch({
@callahad
callahad / lctdjs-persona.js
Last active December 23, 2015 15:09
Let's Code Test Driven JavaScript's Persona integration.
// 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) {
$(".tdjs-signin").click(onSignin);
@callahad
callahad / disable-session-hints.patch
Created September 3, 2013 21:31
Disable Persona session hints
From 21d898eb00cbcb1ffcab7d5e0ec01a4e80499ea5 Mon Sep 17 00:00:00 2001
From: Dan Callahan <dan.callahan@gmail.com>
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