Skip to content

Instantly share code, notes, and snippets.

View dschinkel's full-sized avatar
💻

Dave Schinkel dschinkel

💻
View GitHub Profile
@dschinkel
dschinkel / SkunkWork.kt
Created March 11, 2019 14:41
Android Remove Item Spike
package com.kata.skunkworks
data class SkunkWork(val title: String)
@dschinkel
dschinkel / RomanNumeralCalculator.java
Last active May 16, 2019 04:45
Roman Numeral Calculator Kata
import com.sun.xml.internal.xsom.impl.scd.Iterators;
import java.util.ArrayList;
import java.util.HashMap;
public class RomanNumeralCalculator {
ArrayList<String> numeralOrder = new ArrayList<String>() {{
add("I");
add("V");
@dschinkel
dschinkel / FakeNumberServer.java
Last active March 18, 2019 04:29
FizzBuzz API Kata
import com.fasterxml.jackson.jr.ob.JSON;
import java.util.Map;
import static spark.Spark.get;
import static spark.Spark.port;
public class FakeNumberServer {
public static void main(String[] args) {
port(2000);
@dschinkel
dschinkel / Collections.kt
Last active January 21, 2023 13:58
Kotlin Recipes / Example Snippets
/*
MUTABLE MAPS
------------
Note: Its type is inferred by underlying values within
*/
val toRoman = mutableMapOf(
"IIIII" to "V",
"VV" to "X"
)
@dschinkel
dschinkel / SomeSpecUsingSuperagent.js
Last active May 14, 2019 23:41
Some example Mocha, Supertest, and Superagent tests I've written
/*
Note:
Uses superagent and mocha assertions.
This is how I do these tests nowdays, without supertest, just plain superagent.
*/
import request from 'superagent'
it('returns a list of participants', async () => {
const url = 'https://someurl';
@dschinkel
dschinkel / Calculator.kt
Last active May 17, 2019 06:16
Attempt 4
package roman.numeral.calculator.kotlin
class Calculator {
private val toRoman = mapOf(
"IIIII" to "V",
"VV" to "X",
"XXXXX" to "L",
"LL" to "C",
"CCCCC" to "D",
"DD" to "M"
@dschinkel
dschinkel / Calculator.kt
Last active May 28, 2019 00:30
Roman Numeral Calculator kata - Kotlin
package roman.numeral.calculator.kotlin
class Calculator {
private val toRoman = mapOf(
"IIIII" to "V",
"VV" to "X",
"XXXXX" to "L",
"LL" to "C",
"CCCCC" to "D",
@dschinkel
dschinkel / gulpfile.js
Created July 12, 2019 05:24
Gulp v4 Build
const gulp = require('gulp'),
less = require('gulp-less'),
babel = require("gulp-babel"),
shell = require('gulp-shell'),
mocha = require('gulp-mocha'),
rename = require('gulp-rename'),
bro = require('gulp-bro'),
del = require('del'),
{ series, dest, src } = require('gulp');
@dschinkel
dschinkel / MakeCallTest.java
Last active August 16, 2019 16:25
Roboelectric - Example of Finding a Child Fragment from a test
/*
Dave Schinkel's Notes after he wrote this test:
This is a test I wrote headlessly with Roboelectric around an existing Legacy codebase that's a mess.
We want to get some sort of confidence with an integration test which is what this test gave us for a
certain part of this codebase.
This test indirectly tests behavior further down by
checking what I ultimately expected to be rendered
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#define NUMBER_OF_DAYS 3
// Put your code below:
int main(void)
{
int k, highEntry, lowEntry;
printf("-- -= == IPC Temperature Analyzer == = --\n");
for (int i = 1; i < NUMBER_OF_DAYS; i++)