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 static void Main() { | |
CommandLineArgs args = new CommandLineArgs(Environment.GetCommandLineArgs()); | |
String infile = args["infile"]; | |
if (String.IsNullOrEmpty(infile)) { | |
Console.WriteLine("No input file specified."); | |
throw new Exception("No input file specified."); | |
} |
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
using namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic | |
# Synopsis: Statically analyses the codebase for badness. | |
Add-BuildTask lint -Inputs ${Sources} -Outputs "${PSScriptRoot}/checkstyle.xml" { | |
Import-Module PSScriptAnalyzer | |
# Run the linter, producing a list of result objects. | |
$Results = Invoke-ScriptAnalyzer ` | |
-Path "${PSScriptRoot}" ` | |
-CustomRulePath "${PSScriptRoot}/.lint-rules" ` |
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
#!/usr/bin/env bash | |
DUC_VERSION=${1} | |
if [ -z "${DUC_VERSION}" ]; then | |
echo >&2 "You need to provide a valid release version to package." | |
exit 1 | |
fi | |
if [ ! -f "duc-${DUC_VERSION}.tar.gz" ]; then | |
RELEASE_BASE=https://github.com/zevv/duc/releases/download |
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.google.common.collect.Iterables; | |
import com.google.common.collect.Maps; | |
public final class IterableUtils { | |
public static <T> Map<String, Iterable<T>> group(Iterable<T> input, Map<String, Predicate<T>> groupings) { | |
return Maps.transformValues(groupings, (predicate) -> Iterables.filter(input, predicate)); | |
} | |
private IterableUtils() {} |
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
FROM williamyeh/ansible:alpine3 | |
RUN apk add --no-cache \ | |
gcc \ | |
musl-dev \ | |
python2-dev | |
RUN pip install --upgrade \ | |
pip |
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
#!/bin/bash -e | |
CONTAINER_NAME=ansible | |
function dpsgrep() { | |
pattern=${1} && shift | |
docker ps --format="{{ .Names }}" ${*} \ | |
| grep -q ${pattern} | |
return ${?} | |
} |
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
// Should hash on file write, then save date written, hash value, etc. | |
// Source files should also have this data written on first read, so it can be quickly compared later. | |
// Only rehash if the date-written metadata field is before the last-modified.' | |
// https://docs.oracle.com/javase/tutorial/essential/io/fileAttr.html | |
fun ensureFile(source: Path, target: Path) { | |
when { | |
source.toFile().exists && target.toFile().exists -> { | |
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
#!/usr/bin/env bash | |
IMAGE="${1}" | |
REMOTE_HOST=${2} # You may want to set a default for this | |
REMOTE_USER=${3} # and this | |
REMOTE_SSH="${REMOTE_USER}@${REMOTE_HOST}" # Add a fqdn to the end if it helps | |
REMOTE_FILE="/home/${REMOTE_USER}/export.tar" | |
LOCAL_FILE="$(pwd)/export.tar" | |
ssh "${REMOTE_SSH}" "docker pull ${IMAGE}" || exit 1 |
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
//The global script scope | |
def ctx = context(scope: scriptScope()) | |
contributor(ctx) { | |
method(name: 'build', type: 'Object', params: [job:'java.lang.String'], doc: 'Build a job') | |
method(name: 'build', type: 'Object', namedParams: [parameter(name: 'job', type: 'java.lang.String'), parameter(name: 'parameters', type: 'Map'), parameter(name: 'propagate', type: 'boolean'), parameter(name: 'quietPeriod', type: 'java.lang.Integer'), parameter(name: 'wait', type: 'boolean'), ], doc: 'Build a job') | |
method(name: 'echo', type: 'Object', params: [message:'java.lang.String'], doc: 'Print Message') | |
method(name: 'error', type: 'Object', params: [message:'java.lang.String'], doc: 'Error signal') | |
method(name: 'input', type: 'Object', params: [message:'java.lang.String'], doc: 'Wait for interactive input') | |
method(name: 'input', type: 'Object', namedParams: [parameter(name: 'message', type: 'java.lang.String'), parameter(name: 'id', type: 'java.lang.String'), parameter(name: 'ok', type: 'java.lang.String'), parameter(name: 'par |
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 interface Equatable<T> { | |
Equatator<T> getEquatator(); | |
} |
NewerOlder