Skip to content

Instantly share code, notes, and snippets.

View LocalJetTest.java
package com.example.jet;
import com.hazelcast.core.ManagedContext;
import com.hazelcast.function.FunctionEx;
import com.hazelcast.jet.Jet;
import com.hazelcast.jet.JetInstance;
import com.hazelcast.jet.config.JetConfig;
import com.hazelcast.jet.config.JobConfig;
import com.hazelcast.jet.pipeline.Pipeline;
import com.hazelcast.jet.pipeline.Sinks;
@uklance
uklance / build.gradle
Created Mar 8, 2018
Configuration depends on task
View build.gradle
configurations {
myConfig
}
task addToMyConfig {
doLast {
println "Doing some work"
dependencies {
myConfig 'log4j:log4j:1.2.17'
}
}
@uklance
uklance / AbstractSqlTask.java
Created Aug 22, 2017
Gradle SQL execution without polluting buildscript classloader
View AbstractSqlTask.java
import java.sql.*;
import org.gradle.api.*;
import org.gradle.api.artifacts.*;
import org.gradle.api.tasks.*;
import java.util.*;
import java.net.*;
import java.io.File;
import java.lang.reflect.Method;
public abstract class AbstractSqlTask extends DefaultTask
@uklance
uklance / build.gradle
Created Jun 15, 2017
Gradle monkey patch example for org.springframework:spring-context
View build.gradle
apply plugin: 'java'
ext {
target = 'org.springframework:spring-context:4.3.9.RELEASE'
}
configurations {
monkeyPatchNonTransitive { transitive = false }
monkeyPatchTransitive
}
View gist:0d5bcb56e332dc31f10751e234333638
C:\misc\backup>gradle backup --debug
08:56:18.509 [INFO] [org.gradle.internal.nativeintegration.services.NativeServices] Initialized native services in: C:\Users\43807627\.gradle\native
08:56:18.619 [DEBUG] [org.gradle.internal.nativeintegration.services.NativeServices] Native-platform posix files is not available. Continuing with fallback.
08:56:18.619 [DEBUG] [org.gradle.internal.nativeintegration.filesystem.services.FileSystemServices] Using JDK 7 file service org.gradle.internal.nativeintegration.filesystem.jdk7.WindowsJdk7Symlink
08:56:19.289 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface Software Loopback Interface 1
08:56:19.289 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? true
08:56:19.289 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a multicast interface? true
08:56:19.289 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback address /12
View gist:efa7537285ec9d165489598ec9c8e8bc
buildscript {
ext {
grailsVersion = project.grailsVersion
}
repositories {
//mavenLocal()
maven {
//url "https://repo.grails.org/grails/core"
url uri('C:/workspace/offline/build/offline-repo')
}
@uklance
uklance / AssertCommand.java
Last active Aug 29, 2015
sproc-unit thoughts
View AssertCommand.java
@Events({Event.SCENARIO_THEN, Event.SCENARIO_AFTER})
public class AssertCommand {
@Parameter(requiredGroup="value")
private String sql;
@Parameter(name="attribute", requiredGroup="value")
private String attributeName;
@Parameter(name="expected", required=true)
private String expectedString;
@uklance
uklance / Page.tml
Last active Aug 29, 2015
Tapestry - Render body in parallel
View Page.tml
<t:parallel>
<t:someComponent />
</t:parallel>
View gist:a88099bc2ef7b6039ec7
[INFO] +- org.apache.tapestry:tapestry-core:jar:5.4-beta-22:compile
[INFO] | +- org.antlr:antlr-runtime:jar:3.5.2:compile
[INFO] | +- commons-codec:commons-codec:jar:1.5:compile
[INFO] | +- org.apache.tapestry:tapestry-json:jar:5.4-beta-22:compile
[INFO] | \- org.apache.tapestry:tapestry-ioc:jar:5.4-beta-22:compile
[INFO] | +- org.apache.tapestry:tapestry5-annotations:jar:5.4-beta-22:compile
[INFO] | +- org.apache.tapestry:plastic:jar:5.4-beta-22:compile
[INFO] | +- javax.inject:javax.inject:jar:1:compile
[INFO] | \- org.apache.tapestry:tapestry-func:jar:5.4-beta-22:compile
[INFO] +- com.google.code:sitemapgen4j:jar:1.0.1:compile
View FileBean.java
public class FileBean {
private UploadedFile file;
public void setUploadedFile(UploadedFile file) {
this.file = file;
}
public UploadedFile getUploadedFile() {
return file;
}