Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am oscarfroberg on github.
  • I am oscarfroberg (https://keybase.io/oscarfroberg) on keybase.
  • I have a public key ASBRyPLgNjv5wwoMTo2BsI6HmEuYfzAo5utHY6ZqcxqjuAo

To claim this, I am signing this object:

@oscarfroberg
oscarfroberg / browserid.py
Created Mar 4, 2012 — forked from aaronsw/browserid.py
basic browserid support for web.py
View browserid.py
import urllib, json
class FalseStorage(web.storage):
def __nonzero__(self): return False
def browserid():
c = web.cookies()
if c.get('browserid_assertion'):
out = urllib.urlencode(dict(audience=web.ctx.host, assertion=c.browserid_assertion))
o = json.loads(urllib.urlopen('https://browserid.org/verify', out).read())
if o['status'] == 'failure':
@oscarfroberg
oscarfroberg / browserid.js
Created Mar 4, 2012 — forked from aaronsw/browserid.js
Basic browserid functions for serverside use
View browserid.js
function setCookie(c_name, value, exdays) {
var exdate = new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value = escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie = c_name + "=" + c_value;
}
function browserid_login_callback(assertion){
setCookie('browserid_assertion', assertion, 90);
window.location.reload();
@oscarfroberg
oscarfroberg / .vimrc
Created Mar 3, 2012
vim configuration file
View .vimrc
set encoding=utf-8
set fileencoding=utf-8
set softtabstop=4
set expandtab
set autoindent
set mouse=a
set ignorecase
set smartcase
set pastetoggle=<F9>
set showcmd
You can’t perform that action at this time.