Skip to content

Instantly share code, notes, and snippets.

View davet1985's full-sized avatar

Dave Thompson davet1985

View GitHub Profile

Keybase proof

I hereby claim:

  • I am davet1985 on github.
  • I am davet1985 (https://keybase.io/davet1985) on keybase.
  • I have a public key ASDHBeQI8S777X3xcXr7X5sZJGvgoSWIGfz-UDYcUWCRaQo

To claim this, I am signing this object:

function flatten(object, path, result) {
if (!result) {
result = {};
}
for (let prop in object) {
if (typeof object[prop] !== 'object') {
result[path ? path + prop : prop] = object[prop];
} else {
flatten(object[prop], path ? path + prop + '.' : prop + '.', result);
}

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@davet1985
davet1985 / maven-java-version-config
Last active August 29, 2015 14:02
maven java version config
# check Maven java version
mvn -version
# echo the java 1.7 location
echo $(/usr/libexec/java_home -v 1.7) #/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home
# add JAVA_HOME to .mavenrc file
# WARNING: THIS WILL OVERWRITE YOUR .mavenrc file
echo export JAVA_HOME=$(/usr/libexec/java_home -v 1.7) > ~/.mavenrc
@davet1985
davet1985 / git-config
Last active August 29, 2015 14:01
Useful git configs
# If you cannot access git:// from your network, you can globally replace it with https
git config --global url."https://".insteadOf git://
@davet1985
davet1985 / port-checker
Created May 17, 2014 20:26
Check what is running on a particular port
lsof -i tcp:[port]
e.g.
lsof -i tcp:9393
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')