Skip to content

Instantly share code, notes, and snippets.

View ColinHarrington's full-sized avatar

Colin Harrington ColinHarrington

View GitHub Profile
@ColinHarrington
ColinHarrington / Dockerfile
Created March 13, 2017 20:04
Dockerfile for recreating an issue with installing grails 2.5.5 https://github.com/grails/grails-core/issues/10011
FROM openjdk:8
RUN apt-get update && apt-get install -y --no-install-recommends zip unzip
RUN curl -s get.sdkman.io | bash
# Define commonly used JAVA_HOME variable
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
RUN set -x \
@ColinHarrington
ColinHarrington / .gitconfig
Last active August 29, 2015 13:56
.gitconfig
[branch]
autosetuprebase = always
[mergetool "p4merge"]
cmd = /home/<username>/dir/to/p4v/bin/p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
keepTemporaries = false
trustExitCode = false
keepBackup = false
[merge]
@ColinHarrington
ColinHarrington / gist:7932313
Created December 12, 2013 17:50
Joda-Time Period/months/age example
@Grab(group='joda-time', module='joda-time', version='2.3')
import org.joda.time.*
import org.joda.time.format.*
import java.math.*
LocalDate dob = new LocalDate("1950-06-15")
println dob
Period p1 = new Period(dob, new LocalDate())
Period p2 = new Period(new YearMonth(dob), new YearMonth(new LocalDate()))
@ColinHarrington
ColinHarrington / RunningFeet.ino
Created June 2, 2013 03:59
Little LED App for my feet during the Electric run. Wished I made the startup sequence a couple minute event instead of just the color scroll
#define PI 3.14159265
#define TWO_PI 6.28318531
int redPin = 5;
int greenPin = 3;
int bluePin = 6;
float hue = 0.0;
float saturation = 1.0;
float brightness = 1.0;
"Ann Lenczewski (DFL)" <rep.ann.lenczewski@house.mn>
"Diane Loeffler (DFL)" <rep.diane.loeffler@house.mn>
"Greg Davids (R)" <rep.greg.davids@house.mn>
"Sarah Anderson (R)" <rep.sarah.anderson@house.mn>
"Tom Anzelc (DFL)" <rep.tom.anzelc@house.mn>
"Bob Barrett (R)" <rep.bob.barrett@house.mn>
"John Benson (DFL)" <rep.john.benson@house.mn>
"Lyndon Carlson Sr. (DFL)" <rep.lyndon.carlson@house.mn>
"Jim Davnie (DFL)" <rep.jim.davnie@house.mn>
"Steve Drazkowski (R)" <rep.steve.drazkowski@house.mn>
#!/bin/bash
# Get active window attributes
ACTIVE_WINDOW=$(xdotool getactivewindow)
ACTIVE_GEOMETRY=$(xdotool getwindowgeometry $(xdotool getactivewindow))
ACTIVE_WIDTH=$(echo $ACTIVE_GEOMETRY | cut -d ' ' -f8 | cut -d 'x' -f1)
ACTIVE_HEIGHT=$(echo $ACTIVE_GEOMETRY | cut -d ' ' -f8 | cut -d 'x' -f2)
# Get screen attributes
WIDTH=`xdotool getdisplaygeometry | cut -d' ' -f1`
@ColinHarrington
ColinHarrington / HTTPBuilder_JSON.groovy
Created July 2, 2012 19:27
GUM JSON + HTTP Builder.
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.5.2')
import groovyx.net.http.*
import static groovyx.net.http.ContentType.*
import static groovyx.net.http.Method.*
def http = new HTTPBuilder( 'http://google.com' ) // Takes URL e.g. http://myservice:8087/
http.request( POST, JSON) { req ->
debugLog4j = {
...
}
prodLog4j = {
...
}
development {
log4j = debugLog4j
@ColinHarrington
ColinHarrington / refit.conf
Created April 2, 2012 17:31
rEFIt configuration file
#
# refit.conf
# Configuration file for the rEFIt boot menu
#
# Timeout in seconds for the main menu screen. Setting the timeout to 0
# disables automatic booting (i.e., no timeout).
#
timeout 5