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 com.amazonaws.*; | |
import com.amazonaws.auth.*; | |
import com.amazonaws.services.ec2.*; | |
import com.amazonaws.services.ec2.model.*; | |
buildscript { | |
repositories { mavenCentral() } | |
dependencies { classpath 'com.amazonaws:aws-java-sdk:1.1.9' } | |
} |
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
configurations { sshexec } | |
repositories { mavenCentral() } | |
dependencies { sshexec 'org.apache.ant:ant-jsch:1.8.1' } | |
task ssh << { | |
ant { | |
taskdef(name: 'sshexec', | |
classname: 'org.apache.tools.ant.taskdefs.optional.ssh.SSHExec', | |
classpath: configurations.sshexec.asPath) |
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 array = [] | |
def tmp = "" | |
array = ('0'..'9') + ('a'..'z') + ('A'..'Z') + '_' | |
(1..16).each { | |
tmp += array[Math.floor(Math.random() * array.size()) as int] | |
} | |
println tmp |
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
<html> | |
<head> | |
<title>KeyValue to XML with JavaScript DOM</title> | |
<script type="text/javascript" src="https://gist.github.com/raw/882574/71850ee58b0e489814ddd03fa2f627b41e0c264c/KeyValueXML.js"></script> | |
</head> | |
</html> |
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
println "Hello, world." |
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 kvmap = [ | |
key1: "value1", | |
key2: "value2", | |
key3: [ | |
"key3-1" : "value3-1", | |
"key3-2" : "value3-2", | |
], | |
] | |
sw = new StringWriter() |
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.bluepapa32.gradle.plugins | |
import org.apache.tools.ant.filters.EscapeUnicode | |
import org.gradle.api.Plugin | |
import org.gradle.api.Project | |
import org.gradle.api.plugins.JavaBasePlugin | |
public class Native2AsciiPlugin implements Plugin<Project> { | |
def void apply(Project project) { | |
project.getPlugins().apply(JavaBasePlugin.class); |
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('net.java.dev.jna:jna:3.2.7') | |
import com.sun.jna.*; | |
import com.sun.jna.win32.*; | |
interface Kernel32Library extends StdCallLibrary { | |
Kernel32Library INSTANCE = Native.loadLibrary("kernel32", Kernel32Library.class); | |
boolean SetCurrentDirectoryA(String dir); | |
} | |
Kernel32Library.INSTANCE.SetCurrentDirectoryA("c:/Documents and Settings") |
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
Draggable { | |
node: node | |
var translateX: Number; | |
var translateY: Number; | |
onStart: function(e) { | |
translateX = node.translateX; | |
translateY = node.translateY; | |
} |
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
public class Undoable { | |
public var undo: function(): Void; | |
public var redo: function(): Void; | |
} | |
public class UndoManager { | |
public-init var limit = 10; | |
public-read var redoable: Boolean; |