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('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 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='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 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.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 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
def api = "R_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | |
def user = "your user name" | |
def url = "http://tv.yahoo.co.jp" | |
def version ="2.0.1" | |
def u = "http://api.bit.ly/shorten?version=${version}&longUrl=${url}&login=${user}&apiKey=${api}" | |
def shorten = new URL(u) | |
def result = shorten.text | |
if(result!=""){ |
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 FilterCore { | |
private String pattern | |
private String map | |
private DocObj mydoc | |
boolean proc = false | |
def FilterCore(String pattern,DocObj mydoc){ | |
this.pattern = pattern | |
this.mydoc=mydoc | |
} | |
def tag(map){ |
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
#!/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 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
<appengine:ifLoggedIn>ログインしているときに表示</appengine:ifLoggedIn> | |
<appengine:ifNotLoggedIn>ログインしていないときに表示</appengine:ifNotLoggedIn> | |
<appengine:ifAdminLoggedIn>管理者がログインしているときに表示</appengine:ifAdminLoggedIn> | |
<appengine:ifAdminNotLoggedIn>管理者がログインしていないときに表示</appengine:ifAdminNotLoggedIn> | |
<a href="appengine.loginUrl()">ログインURL</a> | |
<a href="appengine.logoutUrl()">ログアウトURL</a> | |
<appengine:userNickname/> | |
<appengine:userAuthDomain/> | |
<appengine:userEmail/> |
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 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 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
# Step.1 | |
http://dist.codehaus.org/grails/grails-bin-1.1.1.zip | |
#Grailsの設定 | |
export GRAILS_HOME=/opt/grails-1.1.1 | |
export PATH=$GRAILS_HOME/bin:$PATH | |
#appengine-javaの設定 http://code.google.com/appengine/downloads.html | |
export APPENGINE_HOME=/opt/appengine-java-sdk-1.3.0 |
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
package jp.grails | |
import javax.persistence.* | |
import org.datanucleus.jpa.annotations.Extension | |
//import org.hibernate.annotations.* | |
@Entity | |
class Comment implements Serializable { | |
static belongsTo = [todo:Todo] | |