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 groovyx.net.http.RESTClient | |
import static groovyx.net.http.ContentType.XML | |
def login(ip, username, password) { | |
String cookie = "" | |
def ucs = new RESTClient("http://${ip}/nuova") | |
def response = ucs.post( | |
contentType: XML, | |
requestContentType: XML, | |
body: { |
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
ManagedObjectReference currentSnapshot; | |
public void printCurrentSnapshotName() { | |
VirtualMachineSnapshotInfo snapshotInfo = vm.getSnapshot(); | |
if (snapshotInfo != null) { | |
currentSnapshot = snapshotInfo.currentSnapshot; | |
walkSnapshotTree(snapshotInfo.rootSnapshotList); | |
} | |
} |
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 EmailMessage | |
{ | |
private string Sender; | |
private string To; | |
private string Subject; | |
private string Content; | |
private string MimeType; // optional | |
private EmailMessage() { } |
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
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath 'io.ratpack:ratpack-gradle:1.1.1', | |
'com.github.jengelman.gradle.plugins:shadow:1.2.2' | |
} | |
} |
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
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then | |
export TERM='gnome-256color'; | |
elif infocmp xterm-256color >/dev/null 2>&1; then | |
export TERM='xterm-256color'; | |
fi; | |
prompt_git() { | |
local s=''; | |
local branchName=''; |
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
get("report/:start:\\d{4}-\\d{2}-\\d{2}/:end:\\d{4}-\\d{2}-\\d{2}") { ... } |
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 it = { m, f -> println "${(f() ? '✔' : '✘')} It $m" } | |
it("should sum two numbers") { 1 + 1 == 2 } | |
it("should display an X for a failing test") { 1 + 1 == 3 } |
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 io.github.lundvall | |
import groovy.transform.CompileStatic | |
import groovy.transform.Immutable | |
@Immutable | |
@CompileStatic | |
class Interval { | |
long low | |
long high |
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 ratpack.exec.ExecController; | |
import ratpack.server.Service; | |
import ratpack.server.StartEvent; | |
import ratpack.server.StopEvent; | |
import java.util.concurrent.TimeUnit; | |
public class ScheduledService implements Service, Runnable { | |
public String getName() { | |
return getClass().getSimpleName(); |
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
* { | |
background: #000 !important; | |
color: #0f0 !important; | |
outline: solid #f00 1px !important; | |
} |
OlderNewer