Skip to content

Instantly share code, notes, and snippets.

@mrlannigan
mrlannigan / .bash_prompt.sh
Last active December 30, 2015 22:29
Bash Prompt
#!/bin/bash
[ -z "$PS1" ] && return
PROMPT_COMMAND='RET=$?;'
if [ ! -f ~/.git-completion.sh ]; then
curl -s https://raw.github.com/git/git/master/contrib/completion/git-completion.bash > ~/.git-completion.sh && chmod +x .git-completion.sh
fi
@mrlannigan
mrlannigan / gist:7760223
Created December 2, 2013 22:27
Git Bash Completion
#!bash
#
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
@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

'use strict';
/**
* Basic Caching Strategy Class file
* @author Julian Lannigan <[email protected]>
* @since 22AUG2013
*/
(function () {
/**
@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');})()
@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,
var x = 'javascript:showFloorPlan(1000062167,5795229,0);',
regex = /^.*\(([0-9]*),([0-9]*),.*$/;
console.log(x.match(regex));
@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);
}
@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 / 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;