Skip to content

Instantly share code, notes, and snippets.

@cesar1000
cesar1000 / OrderedTestClassScanner.java
Last active April 17, 2024 05:23
Ordered unit tests in Gradle
package com.twitter.gradle.plugin.orderedtest;
import org.gradle.api.file.EmptyFileVisitor;
import org.gradle.api.file.FileTree;
import org.gradle.api.file.FileVisitDetails;
import org.gradle.api.internal.file.RelativeFile;
import org.gradle.api.internal.tasks.testing.DefaultTestClassRunInfo;
import org.gradle.api.internal.tasks.testing.TestClassProcessor;
import org.gradle.api.internal.tasks.testing.TestClassRunInfo;
import org.gradle.api.internal.tasks.testing.detection.TestFrameworkDetector;
@egorsmkv
egorsmkv / build-git.md
Last active May 5, 2023 04:19
Build git from source code on CentOS 7

Build git from source code

1) Go to https://git-scm.com/ and check out the latest version of Git

Currently, the latest version is 2.18.0. Download and extract it and go to the folder of the source code:

wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.18.0.tar.gz
tar xf git-2.18.0.tar.gz
cd git-2.18.0/
@hisplan
hisplan / add-rsync-to-git-bash.md
Created February 21, 2018 09:02
Add rsync to git bash for windows
@bamboo
bamboo / build.gradle.kts
Last active April 21, 2021 18:20
Gradle ArtifactTransform example using the Gradle Kotlin DSL
import org.gradle.api.internal.artifacts.repositories.layout.IvyRepositoryLayout
import java.io.InputStream
import java.util.zip.*
object Attributes {
val artifactType = Attribute.of("artifactType", String::class.java)
val zipType = "zip"
val jars = "jars"
}
@bcalmac
bcalmac / CaseInsensitiveSetMultimap.java
Created March 10, 2015 18:34
Case insensitive SetMultimap using Guava
import com.google.common.collect.ForwardingSetMultimap;
import com.google.common.collect.LinkedHashMultimap;
import com.google.common.collect.Multimap;
import com.google.common.collect.SetMultimap;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
/** SetMultimap decorator that coverts keys to lower case before delegation */
public class CaseInsensitiveSetMultimap<V> extends ForwardingSetMultimap<String, V> {
@lucaswerkmeister
lucaswerkmeister / Tree.ceylon
Created March 18, 2014 21:35
A Tree in Ceylon, by @yellowant’s suggestion
import ceylon.collection { MutableList, LinkedList }
shared interface Tree<Element>
satisfies {Element+}
given Element satisfies Object {
shared formal {Tree<Element>|Element+} children;
shared actual Iterator<Element> iterator() {
object iterator satisfies Iterator<Element> {
@compwron
compwron / gist:7838187
Last active June 20, 2016 23:53
Set annotation processing to "on" when using gradle idea plugin (Intellij 12)
idea.module {
testSourceDirs += file('src/test/unit/java')
testSourceDirs += file('src/test/unit/resources')
excludeDirs += 'file://$MODULE_DIR$/src/main/webapp/node_modules'
}
idea.project {
ipr.withXml { provider ->
def node = provider.asNode()
@randomsync
randomsync / FastTest
Created January 6, 2012 22:50
Suite dependency/ordering in TestNG
import org.testng.ITestContext;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class FastTest {
ITestContext context;
@BeforeMethod
public void setup(ITestContext context) {
this.context = context;