Skip to content

Instantly share code, notes, and snippets.

View dirkharrington's full-sized avatar
😫
Probably preparing for a demo

Dirk J Harrington dirkharrington

😫
Probably preparing for a demo
View GitHub Profile
set ts=4
set sw=4
set softtabstop=4
set expandtab
set number
set lazyredraw
set wildmenu
set showmatch
set incsearch
set hlsearch
@dirkharrington
dirkharrington / steps.md
Last active September 19, 2016 15:11
Steps to import a mvn project into Eclipse

Steps

  1. Ensure the M2_REPO variable is set in Eclipse (Windows -> Preferences -> Java -> Build Path -> Classpath Variables)
  2. mvn eclipse:eclipse from project folder
  3. In Project Explorer, right click -> Import -> General -> Existing project from source
@dirkharrington
dirkharrington / .functions
Created August 16, 2016 14:16
utility shell functions
up () # up 3 to cd ../../..
{
local p= i=${1:-1};
while (( i-- )); do
p+=../;
done;
cd "$p$2" && pwd
}
@dirkharrington
dirkharrington / .inputrc
Created June 27, 2016 17:01
Make bash tab completion better
set completion-ignore-case on
set completion-query-items -1
set show-all-if-ambiguous on
set show-all-if-unmodified on
set skip-completed-text on
@dirkharrington
dirkharrington / .weather
Last active April 5, 2016 14:25
CLI for Weather
alias weather="curl http://wttr.in/Orlando"
private BigInteger checksum(Object obj) throws IOException, NoSuchAlgorithmException {
if (obj == null) {
return BigInteger.ZERO;
}
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(obj);
@dirkharrington
dirkharrington / cwa
Last active March 8, 2016 15:37
Spark Web App Generator
#!/usr/bin/env bash
# To build: mvn compile assembly:single
# To run: java -jar target/<jarname>.jar
# Visit localhost:4567 in browser
groupId="org.dirk"
artifactId="sparkapp"
package=$groupId
@dirkharrington
dirkharrington / gist:bac10c81cb4729a4f1b3
Created June 18, 2014 01:47
Create a CM agnostic patch from a Git repo
git --no-pager diff --no-prefix master..branch
@dirkharrington
dirkharrington / .shopts
Last active August 29, 2015 14:01
Useful BASH shopts that aren't defaulted on
shopt -s globstar
shopt -s expand_aliases
shopt -s cdspell
shopt -s dirspell
shopt -s extglob
@dirkharrington
dirkharrington / .gitrc
Created February 5, 2014 00:54
Simple functions for git
alias gs="git status"
alias gl="git log --stat"
alias gb="git branch -avv"
alias gp="git pull --recurse-submodules --rebase && git submodule update --init"
function gd {
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative $1..$2
}