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('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 |
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
// 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 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
/* | |
original "Translation IF/ELSE´s to Portuguese" | |
http://groovyconsole.appspot.com/script/278001 | |
Translation IF/ELSE´s to Japanese | |
*/ | |
/* DSL to conditional expressions in japanese */ | |
もし = { exp, c -> | |
if (exp){ |
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
/* | |
original "Translation IF/ELSE´s to Portuguese" | |
http://groovyconsole.appspot.com/script/278001 | |
Translation IF/ELSE´s to Japanese | |
*/ | |
/* DSL to conditional expressions in japanese */ | |
モシ = { exp, c -> | |
if (exp){ |
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
/* | |
Kiwanuji on JVM | |
http://kihwanujish.jottit.com/ | |
*/ | |
バブン = {println it} | |
シココケ = {a,b-> assert a==b} | |
バブン "オグモ ハイジ" | |
ラダ = "ゲボ" | |
シココケ(ラダ,"ゲボ") |
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 version = '1.3.7' //target version | |
def released = false | |
def sock | |
int interval = 120 | |
for(;;){ | |
if(!released){ | |
sock = new Socket('dist.springframework.org.s3.amazonaws.com',80) | |
sock.withStreams{input,output-> | |
output << "GET /release/GRAILS/grails-${version}.zip HTTP/1.1\r\n" | |
output << "Host: dist.springframework.org.s3.amazonaws.com\r\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
includeTargets << grailsScript("Init") | |
includeTargets << grailsScript("_GrailsPackage") | |
target(main: "The description of the script goes here!") { | |
compile() | |
createConfig() | |
println config | |
} | |
setDefaultTarget(main) |
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
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
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) |