Skip to content

Instantly share code, notes, and snippets.

@guileen
guileen / app.js
Created April 20, 2011 23:55
Express Custom 404
var express = require('express'),
mongoose = require('mongoose'),
app;
app = module.exports = express.createServer();
app.configure(function() {
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.bodyParser());
app.use(express.methodOverride());
@guileen
guileen / hash.js
Created December 22, 2010 02:15
nodejs crc32 function
/**
* Calculates the hash/checksum of a string. Default algorithm is MD5.
*
* @param {String} str
* @param {String} algorithm
* @return {String} checksum
* @api public
*/
exports.hash = function (str, algorithm) {
if (algorithm === 'crc32') {