Skip to content

Instantly share code, notes, and snippets.

[submodule "wireit"]
path = wireit
url = git://github.com/neyric/wireit.git
[submodule "scripts/chrjs"]
path = scripts/chrjs
url = git://github.com/tiddlyweb/chrjs.git
#!/usr/bin/env python
"""
SAC
SAC ain't Cook (and he doesn't like it either)
Creates a TiddlyWiki document from a TiddlyWeb bag or recipe.
Usage:
"""
random data generator
uses a virtual store implementation
TODO:
* documentation
* rename?
"""
from tiddlyweb.model.bag import Bag
from tiddlyweb.model.recipe import Recipe
from tiddlyweb.store import Store
from tiddlyweb import control
from tiddlyweb.config import config
# set up environment
env = {
"tiddlyweb.config": config
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>jQuery idioms</title>
</head>
<body>
<h1>jQuery idioms</h1>
from tiddlyweb.model.tiddler import Tiddler
from tiddlyweb.model.bag import Bag
from tiddlyweb.store import StoreMethodNotImplemented
from tiddlyweb.stores import StorageInterface
#import MySQLdb as sql -- XXX: temporarily disabled
def init(config):
# register store
class Base(object):
def __init__(self):
pass
def foo(self):
print "base foo"
def bar(self):
print "base bar"
#!/usr/bin/env sh
# loosely based on multi-rbackup.sh by Brice Burgess
#
# settings
#
# source directories (space-separated list) -- N.B.: Exclude trailing slash!
SOURCES="/tmp/btest /tmp/btst"
@FND
FND / dyna.py
Created September 20, 2009 15:13
#!/usr/bin/env python
# exploring ways to dynamically make a class inherit from a class unknown at
# the time of declaration
#
# Usage:
# $ for type in "" CustomDispatch WrapDispatch MetaDispatch FuncDispatch; do ./dyna.py $type; echo "=========="; done
import sys
(function($) {
var _ajax = $.ajax;
$.ajax = function(options) {
if(options && $.inArray(options.type, ["PUT", "DELETE"]) != -1) {
var method = options.type;
var setup = options.beforeSend;
options.type = "POST";
options.beforeSend = function(xhr) {
xhr.setRequestHeader("X-HTTP-Method", method);