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 java.util.regex.*; | |
| import javax.servlet.*; | |
| import javax.servlet.http.*; | |
| public class MyStaticResourceServlet extends HttpServlet { |
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
| class MyBuilder extends BuilderSupport{ | |
| def rootNode | |
| def createNode(name){ | |
| def currentNode = new javax.swing.tree.DefaultMutableTreeNode(name) | |
| if( name=='mystyle' ) | |
| this.rootNode = currentNode |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project default="jar"> | |
| <property environment="env" /> | |
| <path id="groovy.classpath"> <fileset dir="${env.GROOVY_HOME}/embeddable/" /> </path> | |
| <taskdef | |
| name = "groovyc" | |
| classname = "org.codehaus.groovy.ant.Groovyc" | |
| classpathref = "groovy.classpath" /> |
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
| // | |
| // カレントディレクトリにある 文書名_hoge.eps をhoge.eps にコピーする. | |
| // | |
| @Grab(group='commons-io', module='commons-io', version='1.4') | |
| import org.apache.commons.io.* | |
| new File('.').listFiles( { it.name.endsWith('.eps') } as FileFilter ).each{ |
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
| // my merge table cells | |
| init(); | |
| function init(){ | |
| // | |
| var myDoc=app.documents.add(); | |
| var myPage=myDoc.pages.item(0); | |
| var myTextFrame=myPage.textFrames.add(); |
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 org.codehaus.groovy.scriptom.* | |
| // | |
| // 引数として渡されたJSファイルのチェック | |
| // | |
| boolean ng=false | |
| if( args.size()<1 ){ ng=true } | |
| else if( new File(args[0]).exists()==false ){ ng=true } | |
| if(ng){ |
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 java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.InputStreamReader; | |
| public class Test { | |
| public static void main(String[] args) { | |
| File f=new File("sample.xml"); | |
| 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
| // | |
| // groovy chkimg htmlfile | |
| // | |
| @Grab(group='nekohtml', module='nekohtml', version='1.9.6') | |
| import org.cyberneko.html.parsers.SAXParser | |
| def imagelist = { | |
| def rlist = [] |
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='nekohtml', module='nekohtml', version='1.9.6') | |
| import org.cyberneko.html.parsers.SAXParser | |
| def title = { | |
| def t = null | |
| new XmlSlurper(new SAXParser()).parse(it).'**'.findAll{ | |
| if( it.name() == 'TITLE' ){ t = it.toString() } | |
| } | |
| t.trim() | |
| } |
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 #12 Twitter: OAuthの認証サンプル | |
| // | |
| // このコードは以下のサンプル(java)の groovy への移植です. | |
| // http://github.com/kaeppler/signpost-examples/tree/master/OAuthTwitterExample/ | |
| // | |
| // 使い方 : | |
| // | |
| // 0. tw_oauth.groovy(このファイル)の consumerKey と consumerSecret に必要な値(*1)を設定 | |
| // 1. groovy tw_oauth にて実行します. |