This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
changeSet(author: "bryanchug", id: "1383792606533-1") { | |
grailsChange { | |
change { | |
sql.executeUpdate('UPDATE user SET name = :name', [name: 'Bryan Chug']) | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grab(group='mysql', module='mysql-connector-java', version='5.1.6') | |
@GrabConfig(systemClassLoader = true) | |
import groovy.sql.Sql | |
def sql = Sql.newInstance("jdbc:mysql://localhost:3306/noonu?sessionVariables=time_zone='-8:00'", 'root', '', 'com.mysql.jdbc.Driver') | |
println sql.firstRow("select now()") | |
def sql2 = Sql.newInstance("jdbc:mysql://localhost:3306/noonu?sessionVariables=time_zone='%2B8:00'", 'root', '', 'com.mysql.jdbc.Driver') | |
println sql2.firstRow("select now()") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for commit in $(git rev-list origin/master | tail -r) | |
do | |
git reset --hard $commit | |
read -p "Press enter to continue..." | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.time.TimeCategory | |
Date getMaxDate(){ | |
Date maxDate | |
use( TimeCategory ){ | |
maxDate = new Date() + 18.years | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grapes( | |
@Grab(group='org.codehaus.groovy', module='http-builder', version='0.4.1') | |
) | |
import groovyx.net.http.* | |
import static groovyx.net.http.ContentType.* | |
import static groovyx.net.http.Method.* | |
import org.apache.http.auth.* | |
def http = new HTTPBuilder( 'http://www.ipchicken.com' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
modules = { | |
favicon{ | |
resource id: 'favicon', url: [file: 'favicon.ico'], disposition: 'head' | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias grails='~/.gvm/grails/` [ -e application.properties ] && grep app.grails.version application.properties | sed s/app.grails.version=// || echo current `/bin/grails' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grails { | |
mail { | |
host = "smtp.gmail.com" | |
port = 465 | |
username = "[email protected]" | |
password = "password" | |
props = ["mail.smtp.auth":"true", | |
"mail.smtp.socketFactory.port":"465", | |
"mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory", | |
"mail.smtp.socketFactory.fallback":"false"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spock.lang.Specification | |
class FooSpec extends Specification { | |
def 'Test foo'(){ | |
expect: | |
"Bryan".bar == "Bryan is foobar." | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
moduleName = FooExtensions | |
moduleVersion = 0.1 | |
extensionClasses = Foo |
NewerOlder