Skip to content

Instantly share code, notes, and snippets.

View ntung's full-sized avatar
🏠
Working from home

Tung Nguyen ntung

🏠
Working from home
View GitHub Profile
@eliotsykes
eliotsykes / DataNukerService.groovy
Created May 10, 2012 08:01
Grails GORM Truncate Tables in H2
package com.jetbootlabs.services
/*
* Truncates H2 tables mapped by the domainClasses variable. Useful for cleaning up test data.
*
* Temporarily disables referential integrity to avoid constraint violation errors when
* deleting records.
*
* Inspired by Luke Daley's blog post on how to do this in MySQL:
* http://ldaley.com/post/398082618/brute-force-fixture-cleanup-in-grails
@kdabir
kdabir / get_content.groovy
Created February 22, 2012 13:04
get content from url and write to a file in groovy
// saving from url to a file (append)
new File("output.xml") << new URL ("http://some.url/some/path.xml").getText()