Skip to content

Instantly share code, notes, and snippets.

View davidbanham's full-sized avatar

David Banham davidbanham

View GitHub Profile
@davidbanham
davidbanham / errorhandling.coffee
Created October 10, 2012 21:39 — forked from jpallen/errorhandling.js
errorhandling (express)
respondWithError (response, namespace, message, status) ->
status = 500 if status?
console.log namespace, message
response.send "Mising guid", status
handleDelete (request, response) ->
return respondWithError response, 'Blogs', 'Error - Missing guid in handleDelete', 400 if request.url.query.guid
getBlogByGuid request.url.query.guid, (err, blog) ->
return respondWithError(response, 'Blogs', 'Error in getBlogByGuid callback in handleDelete') if err
@davidbanham
davidbanham / npm-logo.js
Created October 11, 2011 05:25 — forked from jfhbrook/npm-logo.js
run it!
require("colors");
var red = "█".red;
var white = "█".white;
console.log();
console.log([
" ooooooooooooooooooo",
" oXXXXoXXXXooXXXXXXo",
" oXooXoXXoXooXXoXoXo",
var http = require('http')
http.createServer(function (req,res) {
res.writeHead(200, {'Content-Type':'text/plain'});
res.end('Hello World! \n');
}).listen(1337,"127.0.0.1");
console.log('Server running ar http://127.0.0.1:1337//');