Skip to content

Instantly share code, notes, and snippets.

@jiffle
jiffle / Effective Email Cheatsheet.md
Last active February 20, 2023 10:30
Effective Email Style Cheatsheet

Military Style For Effective Email Communications

The military structure their communications for maximum clarity and conciseness. These are the key points to write emails in an fffective manner:

1. Prefix Email subject with keyword

Format: STATUS - Message Title

Status keywords:

@jiffle
jiffle / Spock Cheatsheet.md
Last active November 16, 2025 02:14
Spock Useful Patterns Cheatsheet

Spock Useful Patterns Cheatsheet

Adding sequences of behaviour to Mocks and Stubs

The >>> operator allows a sequence of values to be returned:

myMock.someCall() >>> ['first value', 'second value', 'third value', 'etc']

This returns each string in turn. Behaviour (such as throwing exceptions) in closures cannot be used by this operator.

The >> operator allows value or behaviour (closures) to be returned

@jiffle
jiffle / Java 8 Patterns Cheatsheet.md
Last active December 16, 2024 11:12
Cheatsheet of Standard Design Patterns implemented using Java 8 Lambdas

Design Patterns implemented in Java 8

These patterns are implemented using Java 8 Lambdas (together with Project Lombok annotations).

Factory Pattern

Factory I : No Parameter Constructor

Enum class:

@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 December 12, 2025 19:49 — 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"