Skip to content

Instantly share code, notes, and snippets.

1. Basic usage:
<sitemesh srcdir="src"
config="myconfig.xml"
destdir="dest"
includes="*.html"/>
2. Includes/excludes:
<sitemesh srcdir="src"
config="myconfig.xml"
destdir="dest"
<sitemesh>
<!-- There can be multiple <mapping> elements -->
<!-- Apply decorator to all paths by default, unless another matches -->
<mapping decorator="/default-decorator.html"/>
<!-- More mappings, with paths. -->
<mapping path="/path1/*" decorator="/another-decorator.html"/>
<mapping path="/path1/*" decorator="/another-decorator.html"/>
@joewalnes
joewalnes / gist:833611
Created February 18, 2011 12:36
Connect and HTTPS
== In earlier versions of Node, HTTPS with Connect was easy ==
var server = connect.createServer(middleware1, middleware2,...);
server.setSecure(crypto.createCredentials({
key: myHttpsKey,
cert: myHttpsCert
}));
server.listen(port);
This my hilarious conversation, attempting to get a good cable price with Comcast.
Jessica: Hello, I'm a live product specialist. I specialize in setting up new digital services. How may I help you today?
You: hello, I'm trying to figure out which package i should go for to get the best internet speeds
Jessica: I would be happy to go over the details of our packages with you.
Jessica: Let's move this chat and make it a window of its own. That way, you'll still see this web page while we chat. Please click 'Move My Chat' to move it now.
Jessica: Thank you for moving the chat.
Jessica: Before we continue, may I ask if you're an existing Comcast customer?
You: no i'm not.. i'm just about to move into a new house
Jessica: The internet speed is the same in our packages, what varies is the TV options.
@joewalnes
joewalnes / Makefile
Created November 22, 2011 17:51
NPM without NPM
# To find NPM dependencies, use http://search.npmjs.org/
NPM_DEPS += http://registry.npmjs.org/connect/-/connect-1.5.2.tgz
NPM_DEPS += http://registry.npmjs.org/mime/-/mime-1.2.2.tgz
NPM_DEPS += http://registry.npmjs.org/qs/-/qs-0.2.0.tgz
NPM_DEPS += http://registry.npmjs.org/websocket-server/-/websocket-server-1.4.04.tgz
node_modules: Makefile
@rm -rf $@
@mkdir -p $@
@set -e; for DEP in $(NPM_DEPS); do \
@joewalnes
joewalnes / test.pde
Created December 17, 2011 23:33
atmega32u4, leonardo, i2c and serial problem
#include "Wire.h"
#define DS1307_ADDRESS 0x68
struct DateTime {
int second;
int minute;
int hour;
int weekDay;
int monthDay;
@joewalnes
joewalnes / brick.scad
Created January 10, 2012 01:55
Toy brick generator, for OpenSCAD
// resolution of arcs.
$fs = 0.2;
module brick(units_long, units_wide) {
// dimensions (adjust for different brick systems)
piece_length = 5;
piece_height = 6;
wall_thickness = 1;
blob_height = 1;
@joewalnes
joewalnes / shower-lock.scad
Created August 26, 2012 17:59
3D printable shower door lock.
// A 3D printable shower door safety device.
// See: http://www.thingiverse.com/thing:20805
// See: http://todayimade.co/items/joe-walnes-made-shower-door-safety-clip
// 2012, Joe Walnes, Creative Commons Attribution Share Alike, blah de blah.
// Render in http://openscad.org/
//$fn = 24; // Smooth, but very slow rendering
$fn = 12; // Faster!
// All dimensions in mm.
@joewalnes
joewalnes / redis.py
Created August 29, 2012 21:35
Microlibrary: Python Redis client
from telnetlib import Telnet
class RedisLiteClient:
"""
Super lightweight no-frills blocking Redis client that doesn't require any additional dependencies.
This is a microlibrary, designed for easy copy'n'paste into a project, where you don't want to
rely on pip/easy_install/etc.
Usage: