Skip to content

Instantly share code, notes, and snippets.

View ozten's full-sized avatar

Austin King ozten

View GitHub Profile
macro _arms {
rule {(default => $value:expr)} => {
else {
return $value;
}
}
rule {(rule {$cond:expr} => $value:expr)} => {
if($cond) {
return $value;
}
macro _match_cond {
rule {$o($field)} => {
(typeof $o.$field !== 'undefined')
}
rule {$o($field $rest...)} => {
_match_cond $o($field) && _match_cond $o($rest...)
}
}
macro _match_var {
rule {$o($field)} => {
macro $if {
rule {
($x...)
} => {
if (relCar($x...))
}
}
macro $while {
rule {
macro def {
rule {
$name:ident ( $($params:ident : $type:ident) (,) ...) $body
} => {
// just throwing away the type annotation. The semantics of type
// annotations left as an exercise to the reader :)
function $name ($params (,) ...) $body
}
}
Hi folks.. I'm pretty sure everyone involved in Persona ops already
knows about this, but I figured I'd send it to services-ops just to be
completely sure.
My "expire-session" changes[1] finally landed on the master "dev" branch
last friday (10-Aug-2012)[2], and are scheduled to be included in the
branch we'll cut next friday (train-2012.08.17, I think), which should
turn into our Beta1 offering.
This feature includes a schema change, which adds a `lastPasswordReset`
@ozten
ozten / wtf.js
Created February 8, 2012 21:52 — forked from lloyd/wtf.js
const fs = require('fs');
var s = fs.ReadStream("./dialog.orig.js");
s.setEncoding('utf8');
var buf;
s.on('data', function(chunk) {
if (buf) buf += chunk;
else buf = chunk;
@ozten
ozten / thing.py
Created December 5, 2011 23:50 — forked from tofumatt/thing.py
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import (login_required as
auth_login_required)
def login_required(function=None,
redirect_field_name=REDIRECT_FIELD_NAME,
login_url='/'):
"""BrowserID sepcific login_required decorator.

Beneath are basic questions which will be asked by a developer wanting to use BrowserID. They are arranged in order of importance. For each question there are two answers which represent the two competing API proposals (nicknamed the garfield and odie proposals).

At a high level, how do I implement BrowserID support on my webpage?

BOTH garfield and odie APIs are the same:

You need to add a button to your site that, once clicked, will make a javascript call to prompt the user for and identity. You need to call a function at the time your site loads to check to see if a user is already (persistently logged in). Finally, these client side functions provide you with an assertions that you must implement a little bit of server logic to verify.

What do I do in my handler to invoke BrowserID when the user clicks sign in?