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.inject.AbstractModule | |
import static org.ratpackframework.groovy.RatpackScript.ratpack | |
import org.grails.datastore.gorm.mongo.config.* | |
import domains.* | |
ratpack { | |
modules { |
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
buildscript { | |
repositories { | |
maven { url "http://repo.grails.org/grails/repo" } | |
} | |
dependencies { | |
classpath "org.grails:grails-gradle-plugin:2.0.0-SNAPSHOT" | |
} | |
} | |
repositories { |
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='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 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
def 数字 = "〇一二三四五六七八九" | |
def 範囲 = 数字.collect{漢数字->数字.indexOf(漢数字)} | |
println 範囲.collect{段-> | |
範囲.collect{掛-> | |
(段*掛)!=[].size()?(段*掛).toString().collect{数-> 数字[数.toInteger()]}.join() | |
.padLeft(数字.indexOf("二")," ")+" ":"" | |
}.join() | |
}.join("\n") |
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(group='org.pircbotx', module='pircbotx', version='1.5') | |
import org.pircbotx.PircBotX | |
import org.pircbotx.hooks.ListenerAdapter | |
def botName = "oreore" | |
def serverName = "192.168.100.100" | |
def channel = "#channel" | |
def channel2 = "#channel2" | |
def bot = new PircBotX() |
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.sound.midi.* | |
//thx to https://gist.github.com/250489 | |
int ticks = 16 | |
def addNote(track, pitch, start, duration=ticks, velocity=64) { | |
message = new ShortMessage() | |
message.setMessage(ShortMessage.NOTE_ON, pitch, velocity) | |
track.add(new MidiEvent(message, start)) | |
message = new ShortMessage() | |
message.setMessage(ShortMessage.NOTE_OFF, pitch, velocity) |
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 自己紹介を= {a,b->println "それは \"@${b}\" だっ\n\n"},コードでやれと,無茶を言う人がいる='kazuchika' | |
def 致し方ないので自己紹介={a->println "こんばんわ tyamaです\ngrails.jp よろしくです";return ['頑張る':1]} | |
//code | |
自己紹介を コードでやれと, 無茶を言う人がいる | |
致し方ないので自己紹介 '*_*' 頑張る |
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(group='org.pircbotx', module='pircbotx', version='1.5') | |
import org.pircbotx.PircBotX | |
import org.pircbotx.hooks.ListenerAdapter | |
def botName = "your_bot_name" | |
def serverName = "your.servername.com" | |
def channel = "#channel" | |
def bot = new PircBotX() | |
bot.name = bot.nick = bot.login = botName |
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
includeTargets << grailsScript("Init") | |
includeTargets << grailsScript("_GrailsPackage") | |
target(main: "The description of the script goes here!") { | |
compile() | |
createConfig() | |
println config | |
} | |
setDefaultTarget(main) |