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
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('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
@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
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
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
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 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.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 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.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 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
#ifdef DEBUG | |
# define LOG(...) NSLog(__VA_ARGS__) | |
# define LOG_CURRENT_METHOD NSLog(@"%@/%@", NSStringFromClass([self class]), NSStringFromSelector(_cmd)) | |
# define LogPoint(p) LOG(@"%s:%@",#p,NSStringFromCGPoint(p)) | |
# define LogRect(r) LOG(@"%s:%@",#r,NSStringFromCGRect(r)) | |
# define LogSize(s) LOG(@"%s:%@",#s,NSStringFromCGSize(s)) | |
#else | |
# define LOG(...) ; | |
# define LOG_CURRENT_METHOD ; |