Skip to content

Instantly share code, notes, and snippets.

Dexter M Haslem DexterHaslem

View GitHub Profile
@DexterHaslem
DexterHaslem / Prefix migrations with timestamp Groovy task
Created May 25, 2016 — forked from jeremyjarrell/Prefix migrations with timestamp Groovy task
A Groovy task that prefixes new SQL migration files with a timestamp precise to milliseconds. The following usage will add a prefix to any SQL file in a hardcoded directory that does not begin with an number and double leading underscore: $ gradle prefixNewMigrations
View Prefix migrations with timestamp Groovy task
task prefixNewMigrations {
fileTree(dir: 'dev/src/db/listhub').exclude({ isFilePrefixed(it.file) }).each { file ->
doLast {
def timestamp = new Date().format('yyyyMMddHHmmssSSS', TimeZone.getTimeZone('GMT'))
println "Renaming $file.name to ${timestamp}__$file.name"
file.renameTo("$file.parentFile.absolutePath$file.separator${timestamp}__$file.name")
@DexterHaslem
DexterHaslem / .gitignore
Last active Mar 15, 2016 — forked from shuhei/.gitignore
An example `gulpfile.js` for CoffeeScript and Browserify and sourcemaps
View .gitignore
/node_modules
/build
You can’t perform that action at this time.