Skip to content

Instantly share code, notes, and snippets.


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 = 'Build'
genTask.description = 'Generate source code from ANTLR grammar'
bmuschko / OfflineMavenRepository.groovy
Created Dec 4, 2015
Creating an offline Maven repository with Gradle
View OfflineMavenRepository.groovy
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 /
Last active Aug 29, 2015
Gaussian distribution in Java 8 with parallel Streams and LongAdder
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.LongAdder;
public class LongAdderTest {
ConcurrentHashMap<Integer,LongAdder> frequencyMap = new ConcurrentHashMap<>() ;
Random rnd = new Random() ;
void run() {
seanbuscay /
Created Jun 27, 2013
Create an orphan branch in a repo.
cd repository
git checkout --orphan orphan_name
git rm -rf .
rm '.gitignore'
echo "#Title of Readme" >
git add
git commit -a -m "Initial Commit"
git push origin orphan_name