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 com.google.appengine.api.users.User; | |
import com.google.appengine.api.users.UserService; | |
import com.google.appengine.api.users.UserServiceFactory; | |
class AppEngineTagLib { | |
static namespace = "appengine" | |
def ifLoggedIn = { attrs, body -> | |
def userService = UserServiceFactory.getUserService() | |
if (userService.isUserLoggedIn()) { | |
out << body() |
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
#!/usr/bin/env groovy | |
@Grab('nekohtml:nekohtml:latest.integration') | |
import org.cyberneko.html.parsers.SAXParser | |
import groovy.xml.DOMBuilder | |
import groovy.xml.XmlUtil | |
import groovy.xml.dom.DOMCategory | |
/* | |
* gaelyk - utility wrapper command for Gaelyk. | |
* 2010/02/03 [email protected] |
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('org.eclipse.jetty:jetty-server:7.0.1.v20091125') | |
@Grab('org.eclipse.jetty:jetty-servlet:7.0.1.v20091125') | |
import org.eclipse.jetty.server.* | |
import org.eclipse.jetty.server.handler.* | |
import org.eclipse.jetty.servlet.* | |
import groovy.servlet.* | |
server = new Server(8080) | |
servletHandler = new ServletContextHandler(ServletContextHandler.SESSIONS) | |
servletHandler.with { |
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
@GrabResolver(name='HiveDB', root='http://www.hivedb.org/maven/') | |
@Grab('org.hivedb:github-api:1.0') | |
import org.hivedb.github.* | |
hub = new GitHub('glaforge', 'gaelyk') | |
println "Recent commits in ${hub.userName}/${hub.repository}:" | |
hub.commits.each { c -> println """ | |
${c.authorDate} by ${c.author.name} | |
${c.message} | |
${c.url}""" |
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('jivesoftware:smack:3.0.4') | |
@Grab('jivesoftware:smackx:3.0.4') | |
import org.jivesoftware.smack.* | |
(username, password) = ['<<from_username>>', '<<from_password>>'] | |
to = '<<to_username>>@gmail.com' | |
con = new XMPPConnection( | |
new ConnectionConfiguration('talk.google.com', 5222, 'gmail.com')) | |
con.connect() |
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
package exam1; | |
public class WordFilter { | |
private String word; | |
public WordFilter(String word) { | |
this.word = word; | |
} |
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
apply plugin: 'groovy' | |
apply plugin: 'eclipse' | |
repositories { | |
mavenCentral() | |
mavenRepo urls: "http://groovypp.artifactoryonline.com/groovypp/libs-releases-local/" | |
} | |
dependencies { | |
def gppVersion = '0.2.4' |
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('pircbot:pircbot:1.4.2') | |
import org.jibble.pircbot.*; | |
def (host, port, channel) = ['<Server>', <Port>, '<Channel>'] | |
def bot = [:] as PircBot | |
bot.name = 'groovy_bot' | |
bot.encoding = 'ISO-2022-JP' | |
bot.connect host, port | |
bot.joinChannel channel |
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
// g100pon *9 Jakarta POI のGroovyサンプル | |
// | |
// usage: groovy sampleOfGExcelAPI.groovy <入力Excelファイル> | |
// 入力用に適当なExcelファイルを用意してください | |
// ---------------------------- | |
// Grapeによるライブラリ取得 | |
@GrabResolver(name="kobo-repo", root="http://github.com/kobo/maven-repo/raw/master/snapshot") | |
@GrabConfig(systemClassLoader=true) // for workaround a permgen problem with GroovyServ | |
@Grab("org.jggug.kobo:gexcelapi:0.2-SNAPSHOT") |
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
/* | |
Kiwanuji on JVM | |
http://kihwanujish.jottit.com/ | |
*/ | |
バブン = {println it} | |
シココケ = {a,b-> assert a==b} | |
バブン "オグモ ハイジ" | |
ラダ = "ゲボ" | |
シココケ(ラダ,"ゲボ") |
OlderNewer