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('org.twitter4j:twitter4j-stream:2.2.3') | |
import twitter4j.* | |
new TwitterStreamFactory().instance.with { | |
addListener([onStatus:{println "@${it.user.screenName}: ${it.text}"}] as UserStreamAdapter); user() | |
} |
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('org.twitter4j:twitter4j-core:[2.1,)') | |
import twitter4j.* | |
new TwitterFactory().instance.updateStatus "${args[0]} #twitter4j_reading" |
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 java.awt.print.*;PrinterJob.printerJob.with{printable={g,p,i->g.drawString "Hello World!",50,50;i}as Printable;printDialog()&&it.print()} |
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
String.metaClass.rightShiftUnsigned = { delegate > it ? it:delegate } | |
def better = 'Groovy' >>> '越えられない壁' >>> 'Java' | |
println "Hello $better!" |
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 grails.plugin.geb.GebSpec | |
import geb.Page | |
import spock.lang.Shared | |
class PersonEditSpec extends GebSpec { | |
@Shared fixtureLoader | |
def 'きれいなURLで編集画面を開く'() { | |
given: |
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('net.sf.groovydice:groovydice:1.4.1') | |
import net.sf.groovydice.* | |
class TinTiroRinPlugin { | |
def dynamicMethods = { api -> | |
api.add(method:'ttr') { dice -> | |
if (dice.allDice.size() != 3) return "ションベン!" | |
def stats = [all:dice.allDice, count:dice.allDice.countBy{it}] | |
switch (stats) { | |
case { it.count.size() == 1 && it.count[1] }: |
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
/* | |
* Copyright 2011 kiy0taka | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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.xerial:sqlite-jdbc:3.7.2'), @GrabConfig(systemClassLoader=true)]) | |
import groovy.beans.Bindable | |
import groovy.sql.Sql | |
import groovy.swing.SwingBuilder | |
import java.awt.event.* | |
import javax.swing.* | |
import javax.swing.table.* | |
import javax.swing.tree.* | |
import java.util.logging.* |
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
@GrabResolver(name='seasar.org', root='http://maven.seasar.org/maven2/') | |
@Grab('net.arnx.jsonic:jsonic:1.2.0') | |
import net.arnx.jsonic.JSON | |
println JSON.encode([ | |
name:'Kiyotaka OKu', | |
tags:['java', 'groovy', 'jenkins'] | |
]) |
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('org.grails:grails-web:1.3.6') | |
@Grab('org.slf4j:slf4j-nop:1.6.1') | |
import grails.converters.* | |
import org.codehaus.groovy.grails.web.converters.marshaller.* | |
import org.codehaus.groovy.grails.web.converters.configuration.* | |
interface MyMarshaller extends ObjectMarshaller, NameAwareMarshaller {} | |
ConvertersConfigurationHolder.setDefaultConfiguration(XML, new DefaultConverterConfiguration(encoding:'UTF-8')) |