Skip to content

Instantly share code, notes, and snippets.

Matthew Adams matthewadams

Block or report user

Report or block matthewadams

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
matthewadams / jdk
Last active Dec 18, 2015
Easy JVM switcher script for Mac OS X
View jdk
if [ ! $1 ]; then
echo "Please include desired jdk version: 1.7 or 7, 1.6 or 6, ..."
matthewadams / slf4jScriptLogging.groovy
Created May 2, 2013
Convenient logback/slf4j logging closures for Groovy script authors.
View slf4jScriptLogging.groovy
@Grab(group='ch.qos.logback', module='logback-classic', version='[1.0.9,)')
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import ch.qos.logback.classic.Level
logger = LoggerFactory.getLogger("yourScript") // or whatever
logger.level = Level.INFO // or whatever
log = { level, msg, Object... args -> logger."${level.toLowerCase()}"((msg ?: "").toString(), args) }
matthewadams / rmdirs.groovy
Created May 2, 2013
Closure to remove an entire directory tree.
View rmdirs.groovy
rmdirs = {
it = (it instanceof File) ? it : new File(it)
if (!it.exists()) return
it.eachFile { it.delete() }
You can’t perform that action at this time.