Instantly share code, notes, and snippets.

View test-init.go
package main
import (
"log"
"os"
"os/exec"
)
func call(dir string, name string, arg ...string) {
cmd := exec.Command(name, arg...)
View build.gradle
ext.callCounter = 0
task('taskWithInputProperty') {
group 'Test'
inputs.property 'test', {
logger.debug('inputs.property call')
project.ext.callCounter += 1; return 'test'
}
File outputFile = file('test.txt')
doLast {
outputFile.text = 'test'
View .kitchen.yml
driver:
name: ec2
image_search:
name: Windows_Server-2016-English-Full-Base-*
region: eu-west-1
subnet_id: subnet-3615b351
instance_type: t2.micro
aws_ssh_key_id: kitchen
security_group_ids:
- sg-496eaa31
View build.gradle
plugins {
id 'de.gliderpilot.semantic-release' version '1.3.1'
}
task('A_printVersion') {
doLast {
println version
}
}
import com.github.zafarkhaja.semver.Version
View build.gradle
plugins {
id 'maven-publish'
id 'groovy'
id 'de.gliderpilot.semantic-release' version '1.2.0'
id 'com.jfrog.artifactory' version '4.5.4'
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
View gradle.log
10:38:10.516 [INFO] [org.gradle.internal.nativeintegration.services.NativeServices] Initialized native services in: C:\Users\Basil\.gradle\native
10:38:10.599 [DEBUG] [org.gradle.internal.nativeintegration.services.NativeServices] Native-platform posix files integration is not available. Continuing with fallback.
10:38:11.768 [DEBUG] [org.gradle.launcher.daemon.client.DaemonClient] Executing build 355acd67-a988-45d6-a081-18d30ef0e1d2.1 in daemon client {pid=67652}
10:38:12.118 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Software Loopback Interface 1
10:38:12.128 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? true
10:38:12.141 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a multicast interface? true
10:38:12.148 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback address /127.0.0.1
10:38:12.150 [DEBUG] [org.gradle.internal.remote.internal.inet.In
View build.gradle
plugins {
id 'com.github.jlouns.cpe' version '0.5.0'
}
ext.testCmd = {
println tasks['test.cpe'].commandLine
}
task('test1') {
doLast() { testCmd() }
}
task('test.cpe', type: CrossPlatformExec) {
View build.gradle
plugins {
id 'com.github.jlouns.cpe' version '0.5.0'
}
task('test.cpe', type: CrossPlatformExec) {
commandLine(['bundle', '--version'])
}
task('test.cpe.PATHEXT', type: CrossPlatformExec) {
environment << ['PATHEXT': '.exe']
commandLine(['bundle', '--version'])
}
View test.rb
control 'commands' do
impact 1.0
describe command('diff') do
it { should exist }
end
describe command('diff --version') do
its('stdout') { should match /^diff \(GNU diffutils\)/ }
end
end
View test.cmd
REM All OK
go run test.go
REM Create link with full path
mklink /J link "\\?\%cd%"
REM Test new link. Gives something like that:
REM <JUNCTION> link [\\?\R:\!spikes\go-symlink]
dir *link*