Skip to content

Instantly share code, notes, and snippets.

@mrlannigan
mrlannigan / gist:3795558
Created September 27, 2012 18:27
Error Object Utility
/**
* Error Object Utility
*
* The ErrorTypes object defines the arbitrary custom error objects.
*
* Definitions:
* - Each object's key defines the property name in the export
* - Each object can have a 'constructor' property that is executed
* within the constructor of the Error object
* - All other properties of the object are extended onto the prototype
@mrlannigan
mrlannigan / .gitignore
Created October 11, 2012 13:26 — forked from tehnrd/gist:3870100
Node.js http timeout
node_modules
@mrlannigan
mrlannigan / index.js
Created October 14, 2012 15:16
async queue callback test
var async = require('async'), concurrency = 1, i, timestart = Date.now();
var testQueue = async.queue(function(task, callback) {
var _runonce = false;
console.log('running number '+task.number+', time: '+(Date.now() - timestart));
var cb = function() {
if (_runonce) return;
@mrlannigan
mrlannigan / .bashrc
Created December 17, 2012 16:01
Bash Prompt to Display SVN/GIT Current Branch
if [ -f ~/.bash_colors ]; then
. ~/.bash_colors
fi
PROMPT_COMMAND='RET=$?;'
function _returnLambda {
if [[ $RET = 0 ]]; then echo -e "${BGreen}"; else echo -e "${BRed}"; fi;
}
@mrlannigan
mrlannigan / gist:4565351
Created January 18, 2013 15:33
Express.js Debug functions
//debug app use
var use = app.use;
app.use = function(func) {
var ofunc = func;
func = function() {
console.t.log(ofunc.toString());
ofunc.apply(this, arguments);
}
use.call(this, func);
}
var x = 'javascript:showFloorPlan(1000062167,5795229,0);',
regex = /^.*\(([0-9]*),([0-9]*),.*$/;
console.log(x.match(regex));
@mrlannigan
mrlannigan / res.render.js
Created February 27, 2013 21:02
res.render Override Middleware
/**
* Override res.render to do any pre/post processing
*/
app.use(function(req, res, next) {
var render = res.render;
res.render = function(view, options, fn) {
var self = this,
options = options || {},
req = this.req,
app = req.app,
@mrlannigan
mrlannigan / gist:5249348
Created March 26, 2013 21:19
Powered By Debug Address Bar Function
javascript:(function(){var d=getApp().myhomes.overlays.dom.getDialog('debug');d.html('<h3>Copy the following and email to <a href="mailto:[email protected]?subject=Cobrand Debug&[email protected]">[email protected]</a></h3><br><textarea id="debugPB" rows="10" cols="70">Path: '+location.href+"\n"+'Debug: '+"\n"+getApp().tools.cookie.read('PBPARTNER')+'</textarea>').dialog('open');})()
'use strict';
/**
* Basic Caching Strategy Class file
* @author Julian Lannigan <[email protected]>
* @since 22AUG2013
*/
(function () {
/**
@mrlannigan
mrlannigan / README.md
Last active December 22, 2015 06:08
Coldfusion Query Tool

Coldfusion Query Tool

This is a one-page "app" that will allow one to run queries against a configurable datasource.

WARNING

This is not a secure app in any way shape or form. The only form of protection it offers is a check for the cgi.REMOTE_ADDR to be 127.0.0.1. This app uses dangerous methods to run the query.

Requirements