Skip to content

Instantly share code, notes, and snippets.

View dschinkel's full-sized avatar
💻

Dave Schinkel dschinkel

💻
View GitHub Profile
@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 / 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 / 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 / SkunkWork.kt
Created March 11, 2019 14:41
Android Remove Item Spike
package com.kata.skunkworks
data class SkunkWork(val title: String)
@dschinkel
dschinkel / EmailSweeper.java
Last active March 27, 2019 22:26
Pillar Bootcamp
package subscriptions;
import dependencies.User;
import dependencies.UserMailer;
import dependencies.UserRepository;
public class EmailSweeper {
UserMailer mailer;
UserRepository repository;
String unpaidMessage = "Please renew your subscription to Ferret Fancy!";
@dschinkel
dschinkel / no-ddd.md
Last active January 4, 2019 06:01
There is no such thing as "Document Driven Development"

My repsonse to zsup/ddd.md in which he wrote:

Documentation-Driven Development

The philosophy behind Documentation-Driven Development is a simple: from the perspective of a user, if a feature is not documented, then it doesn't exist, and if a feature is documented incorrectly, then it's broken.

  • Document the feature first. Figure out how you're going to describe the feature to users; if it's not documented, it doesn't exist. Documentation is the best way to define a feature in a user's eyes.
  • Whenever possible, documentation should be reviewed by users (community or Spark Elite) before any development begins.
  • Once documentation has been written, development should commence, and test-driven development is preferred.
  • Unit tests should be written that test the features as described by the documentation. If the functionality ever comes out of alignment with the documentation, tests should fail.
  • When a feature is being modified, it should be modified
@dschinkel
dschinkel / company-detail-header-spec.js
Last active May 14, 2019 23:44
React Test Utilities Examples - Early Tests I Wrote for WeDoTDD.com in 2015
// source: https://github.com/dschinkel/we-do-tdd/commit/9e58e254b2c4fc70ebf54ff475079facd2c61d71
import {Component,Store} from 'reactivate';
import CompanyHeader from '../../client/components/companyDetail/CompanyHeader';
import {expect} from 'chai';
import {reactUtil} from '../helper';
const store = Store();
const {renderIntoDocument, find} = reactUtil;
describe('Company Detail - Header', () => {
@dschinkel
dschinkel / oh-my-zsh.commands.csv
Last active November 27, 2018 02:01
my favorite oh-my-zsh commands
alias for git command
ga . git add .
gcmsg git commit -m
gp git push
gp -f git push -f
gst git status
gb git branch
gb git branch
gco git checkout
gco -b git checkout -b
@dschinkel
dschinkel / EditProjectQuestions-Part2.js
Last active February 7, 2019 03:16
Route Component TDD Example - Retrospective
// makes Part2 test pass & removed what we don't need
import * as React from "react";
import { RouteComponentProps } from "react-router";
import WithEditProjectQuestions from "containers/recruiter/WithEditProjectQuestions";
import ProjectQuestionsForm from "components/recruiter/ProjectQuestionsForm";
export class EditProjectQuestions extends React.Component {
public render() {
// we're passing it a dummy function that does nothing to satisfy the ProjectQuestionsForm contract just to get us by
@dschinkel
dschinkel / args.js
Created October 2, 2018 04:33 — forked from ericelliott/args.js
Polymorphic functions and multiple dispatch in JavaScript
var args = [].slice.call(arguments, 0);