Skip to content

Instantly share code, notes, and snippets.

View dschinkel's full-sized avatar
💻

Dave Schinkel dschinkel

💻
View GitHub Profile
@dschinkel
dschinkel / auth.js
Created October 5, 2017 22:02
A method from Auth
renderPlaybackError() {
const {
playbackErrorTheme,
sharedTheme,
playbackErrorChildren,
backgroundInline,
} = this.props;
const { renderPlaybackError, playbackErrorText } = this.state;
return (
@dschinkel
dschinkel / testSpec.js
Created November 1, 2017 06:29
Some Tests Someone added to device.js
define([ "device" ], function (d) {
describe("device", function () {
var device;
var w;
describe("ie6", function () {
before(function () {
w = {
@dschinkel
dschinkel / example.gherkin.txt
Last active January 5, 2018 00:26
Example Gherkin I've Written
Given the user is an artist and is logged in
And the user has one or ore tracks that already meet quality standards
Then the user is prompted to upload a track with message "Do you want to upload a track?"
And when the user selects a track and chooses Yes
Then the track is posted
And the user is shown their Profile
Story: Show FX network series channels
@dschinkel
dschinkel / BoardFactory.js
Last active July 16, 2018 07:50
Medium Blog Post - Data Hiding, Instances, and Better Testing with JS Factories and Closures
import { Marker } from './Constants';
const { EMPTY_CELL } = Marker;
function _Board(grid) {
if(!grid){
grid = [
EMPTY_CELL, EMPTY_CELL, EMPTY_CELL,
EMPTY_CELL, EMPTY_CELL, EMPTY_CELL,
@dschinkel
dschinkel / BoardSingleton.js
Created July 16, 2018 07:38
Medium Blog Post - Data Hiding, Instances, and Better Testing with JS Factories and Closures
let board;
resetToEmptyBoard();
function getBoard() {
return board;
}
function cellIsEmpty(position){
const empty = board[position] === ' ';
return empty;
@dschinkel
dschinkel / EspressoMachine.js
Last active August 9, 2018 20:56
Espresso Machine Refactoring Kata
/*
Some really awful code
*/
// ****** UI ******
// for this blog post we'll pretend this is some working React code as the UI
const dashboard = {
on: () => {
return "<Dashboard on />"
@dschinkel
dschinkel / arrayAttempt1.elm
Last active September 5, 2018 22:12
Elm minMax Kata - Blog Post Snippets
let
board =
[ empty, empty, empty, empty, empty, empty, empty, empty, empty ]
centerPosition =
get 4 board
@dschinkel
dschinkel / arrayAttempt1.error.elm
Created September 5, 2018 19:12
Elm minMax Kata - Blog Post Snippets
Function `get` is expecting the 2nd argument to be:
Array.Array a
But it is:
List Char
@dschinkel
dschinkel / arrays.elm
Created September 5, 2018 22:11
Elm minMax Kata - Blog Post Snippets
-- this is a list
board =
[ markerX, markerX, markerX, empty, empty, empty, empty, empty, empty ]
-- lets make an array from the list
cells =
fromList board
-- access a value at a certain index of the array
get 0 cells
@dschinkel
dschinkel / BasicSpecSyntax.elm
Last active September 7, 2018 03:12
Example of Setting up elm-test-bdd-style and getting it talking to an Elm Module
{--|
This file's tests just contain some pseudo code that will get the test setup to pass by calling an Elm module
it just illustrates how to setup and use elm-test-bdd-style
Notice how below we can use Expect style from both elm-test AND elm-test-bdd-style
https://package.elm-lang.org/packages/rogeriochaves/elm-test-bdd-style/latest
--}
module ExampleSpec exposing (..)