I hereby claim:
- I am cholick on github.
- I am cholick (https://keybase.io/cholick) on keybase.
- I have a public key whose fingerprint is A876 B5BE 5828 CC9E 2D73 5246 D68C 017E 4DF9 A20B
To claim this, I am signing this object:
# Script to initially setup hook globally | |
# For existing repositories, re-run "git init" | |
git config --global init.templatedir '~/.git_template' | |
mkdir -p ~/.git_template/hooks | |
tee > ~/.git_template/hooks/pre-commit << 'EOF' | |
git stash -q --keep-index | |
red=$(tput setaf 1) |
alias fjson="pbpaste | python -m json.tool | pbcopy; pbpaste" | |
alias servedir="python -m SimpleHTTPServer" | |
function setjdk() { if [ $# -ne 0 ];then export JAVA_HOME=`/usr/libexec/java_home -v $@`; fi; java -version; } | |
function lsjdk() { ls -1 /System/Library/Java/JavaVirtualMachines/; ls -1 /Library/Java/JavaVirtualMachines/; } | |
killport() { | |
if [ -z $1 ]; then | |
echo 'Port is required. Usage: "killport 8000"'; | |
return | |
fi | |
local pid=`lsof -i :$1 | grep LISTEN | awk '{print $2}'` |
compileGroovy { | |
groovyOptions.forkOptions.jvmArgs = ['-noverify'] | |
} | |
test { | |
jvmArgs '-noverify' | |
} | |
//applicationDefaultJvmArgs = ['-noverify'] |
import java.util.concurrent.ConcurrentLinkedQueue | |
def results = new XmlSlurper().parse( | |
'http://www.howstuffworks.com/podcasts/stuff-you-should-know.rss'.toURL().openStream() | |
) | |
ConcurrentLinkedQueue<String> queue = new ConcurrentLinkedQueue<String>() | |
public void download(String address) { | |
new File("downloads/${address.tokenize('/')[-1]}.mp3").withOutputStream { out -> |
I hereby claim:
To claim this, I am signing this object:
//Quick test to check the ComparatorChain in the apache-commons libraries. | |
@Grab(group='commons-collections', module='commons-collections', version='3.0') | |
@Grab(group='commons-beanutils', module='commons-beanutils', version='1.8.3') | |
import org.apache.commons.beanutils.BeanComparator | |
import org.apache.commons.collections.comparators.ComparatorChain | |
import org.apache.commons.collections.comparators.NullComparator | |
class Test { |
//useful Groovy example from SpringOne talk by Ken Kousen | |
//hit url using collection for params and display image in swing window | |
import java.awt.BorderLayout as BL | |
import javax.swing.WindowConstants as WC | |
import groovy.swing.SwingBuilder | |
import javax.swing.ImageIcon | |
def base = 'http://chart.apis.google.com/chart?' | |
def params = [cht: 'p3', chs: '400x200', chd: 't:60,40', chl: 'Hello|World'] |
/** | |
* | |
* This script pulls all the issues from github for the project in the working directory | |
* and tosses them onto standard out | |
* Prerequisites: configure git with a username: | |
* $ git config --global github.user username | |
* | |
* @author Matt Cholick | |
* | |
* todo: Deal with rate limiting |
//Minimal configuration needed for Gradle build file with GMetrics integration | |
apply plugin: 'groovy' | |
repositories { | |
mavenCentral() | |
} | |
configurations { | |
gmetrics | |
} |
@Slf4j | |
class RatingServiceIntSpec extends BaseDatabaseIntSpec { | |
RatingService ratingService | |
def setup() { | |
ratingService = injector.getInstance(RatingService.class) | |
} | |
def 'Test that save ratings persists and update'() { |