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.jsoup:jsoup:1.7.1') | |
| def doc = org.jsoup.Jsoup.connect("https://news.google.com/nwshp?hl=zh-TW&tab=wn").get() | |
| doc.select("#s_POPULAR .titletext").each { | |
| node-> | |
| println "title=${node.text()}" | |
| } |
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
| @Grapes([ | |
| @Grab('org.seleniumhq.selenium.client-drivers:selenium-java-client-driver:1.0.2'), | |
| @Grab('org.seleniumhq.selenium:selenium-server:2.25.0'), | |
| @GrabConfig(systemClassLoader=false, initContextClassLoader=true) | |
| ]) | |
| import com.thoughtworks.selenium.* | |
| import org.openqa.selenium.server.* | |
| seleniumServer = new SeleniumServer() |
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
| # default: off | |
| # description: svnserve is the server part of Subversion. | |
| # server_args = -i -r /var/lib/svn/repositories | |
| service svn | |
| { | |
| disable = no | |
| port = 3690 | |
| socket_type = stream | |
| protocol = tcp | |
| wait = no |
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
| worker.list=loadbalancer | |
| worker.loadbalancer.type=lb | |
| worker.loadbalancer.balanced_workers=contpub1 | |
| worker.loadbalancer.sticky_session=1 | |
| worker.loadbalancer.error_escalation_time=0 | |
| worker.loadbalancer.max_reply_timeouts=10 | |
| worker.contpub1.reference=worker.template | |
| worker.contpub1.host=localhost |
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
| lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 | |
| options=3<RXCSUM,TXCSUM> | |
| inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 | |
| inet 127.0.0.1 netmask 0xff000000 | |
| inet6 ::1 prefixlen 128 | |
| gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280 | |
| stf0: flags=0<> mtu 1280 | |
| en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 | |
| options=2b<RXCSUM,TXCSUM,VLAN_HWTAGGING,TSO4> | |
| ether 10:9a:dd:46:41:8d |
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
| # ubuntu vpn server | |
| sudo iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -d 192.168.0.0/24 -j MASQUERADE | |
| # mac os x client | |
| sudo route add 192.168.0.0/24 192.168.100.1 | |
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
| /** | |
| * HttpBuilder Testing | |
| */ | |
| @Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.5.2' ) | |
| import groovyx.net.http.* | |
| import static groovyx.net.http.ContentType.* | |
| import static groovyx.net.http.Method.* | |
| def http = new HTTPBuilder( 'http://localhost:8080' ) |
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
| /** | |
| * sample1.groovy - Koobe Scripting Project | |
| * | |
| * Illustrate how to access data with KoobeCommonData using scripts | |
| * | |
| * Usages: | |
| * groovy sample1.groovy | |
| * | |
| * Required System Environment properties: | |
| * JDBC_CONNECTION_STRING |
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
| \documentclass[$if(fontsize)$$fontsize$,$endif$b5paper]{$documentclass$} | |
| %\documentclass[$if(fontsize)$$fontsize$,$endif$twocolumn]{$documentclass$} | |
| \usepackage[vmargin=$vmargin$,hmargin=$hmargin$]{geometry} | |
| \usepackage{amssymb,amsmath} | |
| \usepackage{ifxetex,ifluatex} | |
| \ifxetex | |
| \usepackage{fontspec,xltxtra,xunicode} | |
| %\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase} | |
| \else | |
| \ifluatex |
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
| #!/usr/bin/env groovy | |
| @Grab('org.apache.pdfbox:pdfbox:1.8.8') | |
| import org.apache.pdfbox.cos.COSArray | |
| import org.apache.pdfbox.cos.COSString | |
| import org.apache.pdfbox.pdfparser.PDFStreamParser | |
| import org.apache.pdfbox.pdfwriter.ContentStreamWriter | |
| import org.apache.pdfbox.pdmodel.PDDocument | |
| import org.apache.pdfbox.pdmodel.PDPage | |
| import org.apache.pdfbox.pdmodel.common.PDStream | |
| import org.apache.pdfbox.util.PDFOperator |