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
'*********************** | |
'刪除過期的檔案(VBScript) | |
'*********************** | |
'天數 | |
daysAgo = 3 | |
'路徑 | |
dirPath = "C:\\test" |
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
cmd = "s3cmd put -P filename s3://contpub/filename" | |
proc = cmd.execute() | |
proc.waitFor() | |
println proc.in.text |
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('org.nuiton.jrst:jrst:1.4') | |
import org.nuiton.jrst.* | |
def reader = new StringReader(''' | |
Title | |
===== | |
Contents here. | |
Sub title |
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 visit_Text(self, node): | |
text = node.astext().replace("\n", '') | |
encoded = self.encode(text) | |
if self.protect_literal_text: |
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
apply plugin: 'java' | |
apply plugin: 'war' | |
apply plugin: 'jetty' | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
compile group: 'javax.servlet', name: 'servlet-api', version: '2.5' |
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 spock.lang.Specification | |
class SimpleReadWriteSpecification extends Specification { | |
def "Simple PLXML file read"() { | |
} | |
} |
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
package com.example; | |
public class Hello { | |
public String sayHello(String who) { | |
return "Hello, " + who; | |
} | |
} |
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='scala-tools', root='http://scala-tools.org/repo-releases') | |
@Grab('org.markdownj:markdownj:0.3.0-1.0.2b4') | |
import com.petebevin.markdown.MarkdownProcessor | |
def m = new MarkdownProcessor() | |
println m.markdown(''' | |
Heading | |
======= |
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
// PostgreSQL | |
@GrabConfig(systemClassLoader=true) | |
@Grab('postgresql:postgresql:9.0-801.jdbc4') | |
def sql = groovy.sql.Sql.newInstance( | |
"jdbc:postgresql://host.example.org/database", | |
"username", "password", "org.postgresql.Driver") | |
// MySQL | |
@GrabConfig(systemClassLoader=true) |
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='net.sf.jedit-syntax', module='jedit-syntax', version='2.2.2') | |
import org.syntax.jedit.JEditTextArea | |
import org.syntax.jedit.tokenmarker.* | |
import groovy.swing.SwingBuilder | |
def mpanel | |
def editor | |
new SwingBuilder().edt { | |
frame(title:'Editor', pack: true, show: true, locationRelativeTo: null) { |
OlderNewer