Skip to content

Instantly share code, notes, and snippets.

Testing droids...

Erik Huizinga erikhuizinga

Testing droids...
Block or report user

Report or block erikhuizinga

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ViewModelOnClearedTest.kt
package com.example
import androidx.lifecycle.ViewModel
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.koin.androidx.scope.currentScope
erikhuizinga / CartesianProduct.kt
Last active Apr 10, 2019
Kotlin function for cartesian product of any number of sets of any size
View CartesianProduct.kt
import kotlin.reflect.KFunction
* Create the cartesian product of any number of sets of any size. Useful for parameterized tests
* to generate a large parameter space with little code. Note that any type information is lost, as
* the returned set contains list of any combination of types in the input set.
fun cartesianProduct(vararg sets: Set<*>): Set<List<*>> =
when (sets.size) {
0, 1 -> emptySet()
erikhuizinga / Pro Pro.terminal
Created Sep 21, 2018
erikhuizinga's Pro Pro macOS Terminal profile
View Pro Pro.terminal
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
erikhuizinga /
Created Jun 18, 2018
Demo of CopyOnWriteArrayList behaviour: while iterating through a previously nonempty list, clearing the list does not influence the iteration: all elements that existed when the iterator was created exist, despite the list being cleared while iterating.
package com.example;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
public class CopyOnWriteArrayListBehaviour {
// Change this to a regular ArrayList to see what different behaviour the CopyOnWriteArrayList has
View FixAppBarLayoutBehavior.kt
* Copyright (C) 2017 The Android Open Source Project & Erik Huizinga
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
erikhuizinga / dataCursorAllTheThings.m
Last active Jan 19, 2018
Demo of how to add data cursor labels to any point in a graph
View dataCursorAllTheThings.m
% Demo of how to add data cursor labels to any point in a graph
close all
x = 1 : 10;
y = randn(size(x));
f = figure;
dcm = datacursormode(f);
l = plot(x, y);

Keybase proof

I hereby claim:

  • I am erikhuizinga on github.
  • I am erikhuizinga ( on keybase.
  • I have a public key ASAXnl_5gUu7v5WZzCpnYwSrQXJMMUnBxwXjUeyU5Ga8Jwo

To claim this, I am signing this object:

erikhuizinga / fisheriris_nomogram.m
Created Feb 12, 2017
MATLAB: Fisher's Iris data set nomogram
View fisheriris_nomogram.m
%% Load data
close all
load fisheriris
selection = 51:length(meas);
length = meas(selection, 1); % sepal length
You can’t perform that action at this time.