Skip to content

Instantly share code, notes, and snippets.

@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 / .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
function bind (scope, func) {
return function () {
func.apply(scope, arguments);
};
}
function A() {
this.console.log('hello A, I\'m logging my output via my this because it is bound to the global context');
}
@mrlannigan
mrlannigan / gitRemote.sh
Created May 30, 2014 17:14
Allow you to operate on git remotes on multiple remote systems.
#!/bin/bash
# call as if calling "git remote"
#
# ./gitRemote.sh add someuser [email protected]:someuser/repo.git
# ./gitRemote.sh remove someuser
ACTION=${@}
USERNAME=myuser
<VirtualHost *:80>
DocumentRoot c:\wamp\www\Portal\HomesCom
ServerName ebbersj.homes.com
Include C:\wamp\www\Portal\serverConfig\rewrites\portal.conf
setEnv ENVIRONMENT_LEVEL development
setEnv DEVELOPER ebbersj
</VirtualHost>
var Hapi = require('hapi');
var server = new Hapi.Server(3000);
var fs = require('fs');
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
var stream = fs.createReadStream('./test.js');
@mrlannigan
mrlannigan / gist:11bf30bd57253f822ee0
Created December 5, 2014 13:18
peer dependencies hate me
λ tmp $ ls -al node_modules
ls: node_modules: No such file or directory
λ tmp $ npm install [email protected]
[email protected] node_modules/hapi
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
@mrlannigan
mrlannigan / agent-example.js
Created December 17, 2014 05:16
example governor-agent
var GovernorAgent = require('governor-agent'),
agent = new GovernorAgent({some: 'connection settings to governor'});
agent.consume('jobname', {some: 'options'}, function (job) {
// do work
return APromise();
});
// home value activation
(function () {
try {
var data = getApp().listing.data;
if (data.isHomeValue == true) {
activate();
}
} catch (e) {
var timer;
timer = setTimeout(function () {console.log('first timer'); timeoutRun()}, 1000);
timer = setTimeout(function () {console.log('second timer'); timeoutRun()}, 1000);
clearTimeout(timer);
function timeoutRun() {
console.log('Timed out!');
}