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
buildscript { | |
repositories { | |
mavenLocal() | |
maven { url "https://repo.grails.org/grails/core" } | |
} | |
dependencies { | |
classpath "org.grails:grails-gradle-plugin:$grailsVersion" | |
//classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}" | |
//classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.14.2" | |
} |
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 org.codehaus.groovy.groovydoc.GroovyRootDoc | |
import org.codehaus.groovy.tools.groovydoc.GroovyDocTool | |
import static groovy.io.FileType.FILES | |
/** | |
* Generate i18n messages.properties from the domain class comments | |
* | |
* grails generate-i18n-labels | |
* grails generate-i18n-labels {target lang} | |
* grails generate-i18n-labels {lang} {target package} |
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
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 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 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
@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 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 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) |
NewerOlder