Skip to content

Instantly share code, notes, and snippets.


Jonathan Ruckwood jon-ruckwood

View GitHub Profile
jon-ruckwood /
Created Apr 25, 2020
Compile with `--enable-preview`
public class Java14RecordExample {
public static void main(String[] args) {
var p = new Person("Boz", "Scaggs");
System.out.println("toString(): " + p);
System.out.println("Howdy " + + "!");
jon-ruckwood /
Created Jan 17, 2020
Java 14 record example, compile and run with `--enable-preview`
public class RecordExample {
public static void main(String[] args) {
Interval i = new Interval(1, 2);
System.out.println("interval: " + i);
record Interval(int begin, int end) {

Keybase proof

I hereby claim:

  • I am jon-ruckwood on github.
  • I am jonruckwood ( on keybase.
  • I have a public key ASD48-tGDeaPKLmIraDUETGDE-w5eHJnNvkHlpRX1w377go

To claim this, I am signing this object:

View word_count.go
package main
import (
func WordCount(s string) map[string]int {
counts := make(map[string]int)
View dashboard-adminuser.yaml
# refer to -
apiVersion: v1
kind: ServiceAccount
name: admin-user
namespace: kube-system
kind: ClusterRoleBinding


jon-ruckwood /
Created May 16, 2018
Mini JUnit5 extension simulating the useful expected exception functionality of JUnit4
@Target({ ElementType.TYPE, ElementType.METHOD })
public @interface IgnoreException {
Class<? extends Throwable>[] value();
public class IgnoreExceptionExtension implements TestExecutionExceptionHandler {
public void handleTestExecutionException(ExtensionContext context, Throwable throwable) throws Throwable {
IgnoreException annotation = context.getRequiredTestMethod().getAnnotation(IgnoreException.class);
jon-ruckwood /
Last active May 9, 2018
Notes on Venkat Subramaniam's Java 9 and Java 10: The Key Parts
// Java 9
// JDK improvements
Stream#takeWhile // `limit` using a predicate, i.e. `break`
Stream#dropWhile // `skip` using a predicate, i.e. `continue`
Stream#iterate // emulate a for-loop with a stream, e.g. (not previously possible)
View zaw.zsh
zstyle ':prezto:module:zaw' default-history-search 'yes'
zstyle ':filter-select:highlight' matched fg=green
zstyle ':filter-select' max-lines 3
zstyle ':filter-select' case-insensitive yes # enable case-insensitive
zstyle ':filter-select' extended-search yes # see below
jon-ruckwood /
Last active Feb 1, 2018
Intellij bits and pieces

Live Templates

ee – JUnit ExpectedException rule
public org.junit.rules.ExpectedException expectedException = org.junit.rules.ExpectedException.none();$CURSOR$
mk – JUnit Mockito rule
You can’t perform that action at this time.