Skip to content

Instantly share code, notes, and snippets.

View levity's full-sized avatar

Lawrence Wang levity

View GitHub Profile
@levity
levity / fb_connect.html
Created December 8, 2010 06:26
Facebook Connect
<html>
<body>
<div id="login" style="display: none">
<fb:login-button perms="email"></fb:login-button>
</div>
<div id="logout" style="display: none">
<button onclick="FB.logout()">Log out</button>
</div>
@levity
levity / identitymap.rb
Created December 7, 2010 01:22
DataMapper Identity Map on Rack
## somewhere
module Persistence
class IdentityMap
def initialize(app)
@app = app
end
def call(env)
DataMapper.repository { @app.call(env) }
end
javascript:function iprl5() {
var d=document,
z=d.createElement('scr'+'ipt'),
b=d.body,
l=d.location;
try {
if (!b) throw(0);
d.title='(Saving...)'+d.title;
z.setAttribute('src',l.protocol+'//www.instapaper.com/j/LIq7XKV1Bp1I?u='+encodeURIComponent(l.href)+'&t='+(new Date().getTime()));