Skip to content

Instantly share code, notes, and snippets.

@jiffle
jiffle / Java 8 Cheatsheet.md
Last active February 17, 2017 15:53
Cheatsheet for Java 8 Lambda syntax

Java Lambda Syntax

As an expression

(Person p) -> p.getGender() == Person.Sex.MALE
    && p.getAge() >= 18
    && p.getAge() <= 25

As a local variable

@jiffle
jiffle / GradleCheatsheet.md
Last active March 24, 2025 20:13 — forked from qrman/GradleCheatsheet.md
Cheatsheet of Gradle Commands and Config

Command Cheatsheet

  • Convert Maven build to gradle

    gradle init

  • Initialise new project folder structure (Java example)

    gradle init --type java-library

@jiffle
jiffle / gradle-cheatsheet.gradle
Last active October 5, 2017 07:54 — forked from jahe/gradle-cheatsheet.gradle
Gradle File with Many Common Examples
// imports a couple of java tasks
apply plugin: "java"
// List available tasks in the shell
> gradle tasks
// A Closure that configures the sourceSets Task
// Sets the main folder as Source folder (where the compiler is looking up the .java files)
sourceSets {
main.java.srcDir "src/main"