Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de" id="facebook" class=" no_js">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-language" content="de" />
<script type="text/javascript">function arrivedHtml(id,text) { var b=document.getElementById(id); b.innerHTML = text; }</script></HEAD><BODY>
<div>Progressive Loading
<div id="content1">-</div>
<div id="content2">-</div>
</div>
.mouse, #preview{
position: absolute;
background-repeat: no-repeat;
height: 22px;
min-width: 15px;
z-index: 100;
}
.mouse{
background-image: url('../images/cursor.png');
import bisect
class NFA(object):
EPSILON = object()
ANY = object()
def __init__(self, start_state):
self.transitions = {}
self.final_states = set()
self._start_state = start_state
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@psd
psd / index.html
Created August 31, 2010 21:12
cards for a REST design exercise
<!doctype html>
<html>
<head>
<style>
body {
font-family: "Helvetica Neue", Arial;
padding: 10mm;
}
h2 {
clear: both;
<resource href="/orders">
<link rel="next" href="/orders?page=2" />
<link rel="search" href="/orders?id={order_id}" />
<resource rel="order" href="/orders/123">
<link rel="customer" href="/customer/bob" title="Bob Jones <bob@jones.com>" />
<resource rel="basket" href="/orders/123/basket">
<item>
<sku>ABC123</sku>
<quantity>2</quantity>
<price>9.50</price>
{
"_links" : {
"search" : { "href" : "/todo-list/search;{searchterm}" },
"description" : { "href" : "/todo-list/description" }
},
"_embedded" : {
"owner" : {
"_links" : {
"self" : { "href" : "http://range14sux.com/mike"},
"friend" : { "href": "http://mamund.com/" }
@jsimmons
jsimmons / config.lua
Created September 14, 2010 08:32
Mongrel2 config loading, in lua
local chat_demo = Handler {
send_spec = 'tcp://127.0.0.1:9999';
send_ident = '8b7c7833-0932-4d9a-92c3-3b8c06d9b855';
recv_spec = 'tcp://127.0.0.1:9998';
recv_ident = '';
}
local chat_demo_dir = Dir {
base = 'static/chatdemo/';
index_file = 'index.html';
<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- Disable automatic DNS prefetching.

Idiot-Proof Git Aliases