Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
# DEBUG
item="foo bar lorem ipsum"
item="foo bar t:2009-02-26 lorem ipsum"
item="foo bar t:2009-02-27 lorem ipsum"
item="foo bar t:2009-02-28 lorem ipsum"
# check for threshold
if [[ $item = *t:* ]]; then # check for threshold marker
/**
* Checks that the given expression throws an exception of the expected type, with an optional message.
*
* @example raises( function() { return foo.bar; }, "TypeError", "invalid property access raises TypeError exception" );
*
* @param Function expression
* @param String expected exception type
* @param String message (optional)
*/
function raises(expression, expected, message) {
/***
simplified version of the ListNavMacro:
http://svn.tiddlywiki.org/Trunk/contributors/FND/plugins/ListNavMacro.js
!Usage
{{{
<<listnav tiddler>>
}}}
<<listnav [[ColorPalette]]>>
***/
/*
* make Bespin use the local file system for storage
*
* requires jquery.file.save and jquery.file.load:
* http://trac.tiddlywiki.org/browser/Trunk/core/jquery/plugins/
*/
(function() {
// provide jQuery functionality required by file-system code
//{{{
config.macros.toggleReadOnly = {
label: "toggle",
tooltip: "toggle read-only mode",
handler: function(place, macroName, params, wikifier, paramString, tiddler) {
createTiddlyButton(place, this.label, this.tooltip, this.toggle);
},
toggle: function() {
from tiddlyweb.config import DEFAULT_CONFIG
def init(config):
print "invoking TiddlyDocs"
app_tiddlers = [
"file:///home/fnd/Dev/TiddlyWiki/TiddlyWiki.org/association/serversides/cctiddly/Trunk/plugins/TiddlyDocs/files/split.recipe"
]
config["instance_tiddlers"] = config["instance_tiddlers"] + [("common", app_tiddlers)]
<!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>JavaScript-based game experiment</title>
<link rel="stylesheet" type="text/css" href="styles/main.css">
</head>
<body>
from tiddlyweb.web import util as web
def init(config):
# extend urls.map
config["selector"].add("/test/{url:any}", GET=get_request)
def get_request(environ, start_response):
content = str(environ)
# -*- coding: UTF-8 -*-
"""
test case for the following error:
UnicodeEncodeError:
'ascii' codec can't encode character u'\xf6' in position 1:
ordinal not in range(128)
"""
* {
margin: 0;
padding: 0;
}
html {
background-color: #000;
}
body {