Skip to content

Instantly share code, notes, and snippets.

Dan Callahan callahad

Block or report user

Report or block callahad

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

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 Aug 12, 2016
ES7 Async to ES6 via Babel
View 0 - README.md

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 Aug 29, 2015
Slides from Software Freedom Day 2015
View sfd.md

%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 Jun 4, 2018
Preliminary Firefox Sync Dockerfile
View 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 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

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 Nov 26, 2013
Authority discovery draft.
View discovery.md

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 Nov 25, 2013
Proposed Goldilocks API spec
View api-rp.md

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 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:
*
* navigator.id.watch({
@callahad
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) {
$(".tdjs-signin").click(onSignin);
@callahad
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 <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
You can’t perform that action at this time.