Skip to content

Instantly share code, notes, and snippets.

Avatar

Schalk W. Cronjé ysb33r

  • Andorra
View GitHub Profile
View Antlr4Plugin.groovy
class Antlr4Plugin implements Plugin<Project> {
void apply(Project project) {
project.with {
apply plugin : 'java'
configurations.maybeCreate 'antlr'
Antlr4GenerationTask genTask = tasks.create 'generateGrammarSource', Antlr4GenerationTask
genTask.group = 'Build'
genTask.description = 'Generate source code from ANTLR grammar'
@bmuschko
bmuschko / OfflineMavenRepository.groovy
Created Dec 4, 2015
Creating an offline Maven repository with Gradle
View OfflineMavenRepository.groovy
package org.gradle.training
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.TaskAction
import org.gradle.api.DefaultTask
import org.gradle.util.GFileUtils
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.component.ModuleComponentIdentifier
import org.gradle.maven.MavenModule
@timyates
timyates / LongAdderTest.java
Last active Aug 29, 2015
Gaussian distribution in Java 8 with parallel Streams and LongAdder
View LongAdderTest.java
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.LongAdder;
import java.util.stream.IntStream;
public class LongAdderTest {
ConcurrentHashMap<Integer,LongAdder> frequencyMap = new ConcurrentHashMap<>() ;
Random rnd = new Random() ;
void run() {
@seanbuscay
seanbuscay / git_create_orphan.sh
Created Jun 27, 2013
Create an orphan branch in a repo.
View git_create_orphan.sh
cd repository
git checkout --orphan orphan_name
git rm -rf .
rm '.gitignore'
echo "#Title of Readme" > README.md
git add README.md
git commit -a -m "Initial Commit"
git push origin orphan_name