Skip to content

Instantly share code, notes, and snippets.

View jkuhnert's full-sized avatar

Jesse Kuhnert jkuhnert

View GitHub Profile
@jkuhnert
jkuhnert / ansiparse.js
Created February 19, 2015 16:57
javascript ansi parser
// Taken from: https://github.com/travis-ci/travis-web/blob/76af32013bc3ab1e5f540d69da3a97c3fec1e7e9/assets/scripts/vendor/ansiparse.js
var ansiparse = function (str) {
//
// I'm terrible at writing parsers.
//
var matchingControl = null,
matchingData = null,
matchingText = '',
ansiState = [],
result = [],
@jkuhnert
jkuhnert / MDCContextListeningDecorator.java
Created December 11, 2014 19:13
logback MDC + guava
import com.google.common.util.concurrent.AbstractListeningExecutorService;
import org.slf4j.MDC;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import static com.google.common.base.Preconditions.checkNotNull;
@jkuhnert
jkuhnert / gist:481dfb99f4e07dd1cec0
Created July 24, 2014 18:25
How to diff two xml files..
$ xmllint --c14n one.xml > 1.xml
$ xmllint --c14n two.xml > 2.xml
$ diff 1.xml 2.xml
@jkuhnert
jkuhnert / boot2docker-fwd
Created June 26, 2014 22:19
Fork of helpful boot2docker port mapping utility script
#!/bin/bash
usage ()
{
cat <<UsageHERE
boot2docker-fwd -- Helper function to quickly manage port forwards between the boot2docker-vm and the host
Usage: boot2docker-fwd [ -n RULE_NAME ] [ -h HOST_PORT ] [ -p {tcp|udp} ] [ -i HOST_IP ] GUEST_PORT
or boot2docker-fwd -d RULE_NAME
or boot2docker-fwd -l
or boot2docker-fwd -A
{Alabama:"Ala.",Arizona:"Ariz.",Arkansas:"Ark.",California:"Calif.",Colorado:"Colo.",Connecticut:"Conn.",Delaware:"Del.","District of Columbia":"D.C.",Florida:"Fla.",Georgia:"Ga.",Illinois:"Ill.",Indiana:"Ind.",Kansas:"Kan.",Kentucky:"Ky.",Louisiana:"La.",Maine:"Me.",Maryland:"Md.",Massachusetts:"Mass.",Michigan:"Mich.",Minnesota:"Minn.",Mississippi:"Miss.",Missouri:"Mo.",Montana:"Mont.",Nebraska:"Neb.",Nevada:"Nev.","New Hampshire":"N.H.","New Jersey":"N.J.","New Mexico":"N.M.","New York":"N.Y.","North Carolina":"N.C.","North Dakota":"N.D.",Oklahoma:"Okla.",Oregon:"Ore.",Pennsylvania:"Pa.","Puerto Rico":"P.R.","Rhode Island":"R.I.","South Carolina":"S.C.","South Dakota":"S.D.",Tennessee:"Tenn.",Texas:"Tex.",Vermont:"Vt.",Virginia:"Va.",Washington:"Wash.","West Virginia":"W.Va.",Wisconsin:"Wis.",Wyoming:"Wyo."}
@jkuhnert
jkuhnert / _.md
Created May 22, 2014 16:49
pattern_Seq
@jkuhnert
jkuhnert / _.md
Created May 22, 2014 16:14
Drought 1
@jkuhnert
jkuhnert / _.md
Created May 22, 2014 16:12
SO one axis to rule them all
@jkuhnert
jkuhnert / text.js
Created May 21, 2014 13:09
d3.svg.textWrap
/**
* Taken from https://github.com/mbostock/d3/pull/1732
*
* Description from pull:
*
* Adds a .textWrap() function which can be configured with .bounds() and .padding() and applied to a
* text selection using .call(), and will then auto-calculate text length and positioning for dividing
* into tspans accordingly.
* */

Keybase proof

I hereby claim:

  • I am jkuhnert on github.
  • I am jkuhnert (https://keybase.io/jkuhnert) on keybase.
  • I have a public key whose fingerprint is 5750 993A 175B 8914 F55A 6323 9F4B 9C31 B8C3 62CC

To claim this, I am signing this object: