This file contains hidden or 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('com.gmongo:gmongo:0.9.5') | |
@GrabConfig(systemClassLoader=true) | |
import com.gmongo.GMongo | |
import com.mongodb.* | |
import javax.swing.UIManager | |
import groovy.ui.Console | |
import org.codehaus.groovy.control.CompilerConfiguration | |
import org.codehaus.groovy.control.customizers.ImportCustomizer | |
import groovy.transform.* |
This file contains hidden or 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
#jt12_b101 (849) | |
#groovy (233) | |
#scala (185) | |
#javaonejp (152) | |
#jruby (91) | |
#kink (24) | |
#せっって打って予測変換3つ晒せよ (7) | |
#scalar (7) | |
#jython (7) | |
#java (6) |
This file contains hidden or 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
class Person { | |
String name | |
static constraints = { | |
name nullable:false | |
} | |
} | |
Person.metaClass.validate = { | |
def personInstance = delegate | |
personInstance.constraints.delegate = personInstance |
This file contains hidden or 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
mkdir python | |
curl -O http://peak.telecommunity.com/dist/virtual-python.py | |
python virtual-python.py --prefix=$WORKSPACE/python | |
curl -O http://peak.telecommunity.com/dist/ez_setup.py | |
echo '[install] | |
install_lib = $WORKSPACE/python/lib | |
install_scripts = $WORKSPACE/python/bin' > ~/.pydistuils.cfg | |
export PATH=$WORKSPACE/python/bin:$PATH | |
export PYTHONPATH=$WORKSPACE/python:$WORKSPACE/python/lib | |
python ez_setup.py |
This file contains hidden or 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.logg=log --graph --date-order -C -M --pretty=format:"<%h> %ad [%cn] %Cgreen%d%Creset %s" --all --date=relative |
This file contains hidden or 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('com.madgag:org.eclipse.jgit:1.0.99.0.7-UNOFFICIAL-ROBERTO-RELEASE') | |
import org.eclipse.jgit.api.* | |
if (!args) System.exit(0) | |
def params = [*args] | |
def commands = [ | |
init: { | |
def cli = new CliBuilder() | |
cli._ longOpt: 'bare', 'bare' |
This file contains hidden or 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
// ==UserScript== | |
// @name bitbucket_clone_url | |
// @namespace http://d.hatena.ne.jp/kiy0taka/ | |
// @include https://bitbucket.org/kiy0taka/* | |
// ==/UserScript== | |
(function() { | |
var element = document.getElementById('clone-url-ssh') | |
element.textContent = element.textContent.replace(/[email protected]:(.*?)\/(.*?)\.git/, function(all, user, repo) { | |
return 'ssh://[email protected]/' + user + '/' + repo | |
}) |
This file contains hidden or 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 play.db.jpa.JPA | |
import models.* | |
def jpa = new JPA() | |
def em = jpa.entityManager = JPA.newEntityManager() | |
JPA.local.set(jpa) | |
def trx = em.transaction | |
trx.begin() |
This file contains hidden or 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 javax.swing.UIManager | |
import groovy.ui.Console | |
import org.codehaus.groovy.control.CompilerConfiguration | |
import org.codehaus.groovy.control.customizers.ASTTransformationCustomizer | |
import groovy.transform.* | |
def transformations = [ThreadInterrupt, Canonical] | |
Console.metaClass.newScript = { ClassLoader parent, Binding binding -> | |
def config = new CompilerConfiguration() |
This file contains hidden or 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('org.apache.ant:ant-javamail:1.8.1'), @GrabConfig(systemClassLoader=true)]) | |
import groovy.ui.Console | |
import groovy.ui.SystemOutputInterceptor; | |
import javax.swing.UIManager | |
UIManager.lookAndFeel = UIManager.systemLookAndFeelClassName | |
def console = new Console() | |
def origin = console.&finishException | |
console.metaClass.finishException = { Throwable t, boolean executing -> | |
origin.call(t, executing) |