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 app; | |
import org.springframework.beans.MutablePropertyValues; | |
import org.springframework.beans.factory.support.BeanDefinitionRegistry; | |
import org.springframework.beans.factory.support.GenericBeanDefinition; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.http.MediaType; | |
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; | |
import org.springframework.http.server.ServletServerHttpResponse; | |
import org.springframework.web.servlet.ModelAndView; |
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.grails:gorm-hibernate4-spring-boot:1.1.0.RELEASE") | |
@Grab("com.h2database:h2:1.3.173") | |
import grails.persistence.* | |
import org.springframework.http.* | |
import static org.springframework.web.bind.annotation.RequestMethod.* | |
// curl -XPOST http://localhost:8080/person/add -F 'firstName=Tony' | |
// curl -XGET 'http://localhost:8080/person/greet?firstName=Tony' | |
@RestController | |
class GreetingController { |
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.grails:grails-datastore-gorm-mongodb:4.0.0.RELEASE") | |
@Grab("org.springframework:spring-expression:4.1.6.RELEASE") | |
@Grab('org.slf4j:slf4j-simple:1.7.12') | |
import grails.persistence.* | |
import grails.mongodb.geo.* | |
import grails.mongodb.bootstrap.* | |
import org.bson.types.ObjectId | |
import com.mongodb.BasicDBObject | |
def initializer = new MongoDbDataStoreSpringInitializer(City) |
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.grails:gorm-mongodb-spring-boot:1.1.0.RELEASE') | |
import grails.persistence.* | |
import grails.mongodb.geo.* | |
import org.bson.types.ObjectId | |
import com.mongodb.BasicDBObject | |
import com.mongodb.Mongo | |
import org.springframework.http.* | |
import org.springframework.beans.factory.annotation.Autowired | |
import org.springframework.data.mongodb.core.mapping.MongoMappingContext | |
import static org.springframework.web.bind.annotation.RequestMethod.* |
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.intellij.patterns.PsiJavaPatterns | |
import com.intellij.patterns.PlatformPatterns | |
def ctx = context( | |
ctype: PsiJavaPatterns.psiClass().withName(PlatformPatterns.string().matches(/.*/)) | |
) | |
contributor(ctx) { | |
def path = "" | |
try { |
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='grails-core', root='http://repo.grails.org/grails/core') | |
@Grab(group='org.grails', module='grails-datastore-gorm-mongo', version='1.0.0.BUILD-SNAPSHOT') | |
@Grab(group='org.slf4j', module='slf4j-simple', version='1.6.1') | |
import grails.persistence.* | |
import org.grails.datastore.gorm.mongo.config.* | |
MongoDatastoreConfigurer.configure("myDatabase", Book) | |
Book.withSession { |
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('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 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} | |
バブン "オグモ ハイジ" | |
ラダ = "ゲボ" | |
シココケ(ラダ,"ゲボ") |
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
@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 |
NewerOlder