Skip to content

Instantly share code, notes, and snippets.

View dschinkel's full-sized avatar
💻

Dave Schinkel dschinkel

💻
View GitHub Profile
@iansheridan
iansheridan / api.feature
Created July 20, 2011 11:59 — forked from adamstrickland/api.feature
Cucumber Example for testing a RESTful API
Scenario: Get List of My Hitchhiking Items via API
Given the existing things:
|name|
|The Guide (duh)|
|A towel|
|Sub-Etha Sens-O-Matic|
|Pan Galactic Gargle Blaster|
|Kill-o-Zap blaster pistol|
And the existing accounts:
|email|name|password|
/*
This list will be continually updated with new templates.
If you have requests for any, please add a comment using the comment box at the bottom of this page.
NOTE: the comments are just to facilitate reading this gist, don't include those in your IntelliJ Live Templates.
some comments are just suggested template abbreviations for the live templates once you add them to your IDE
OSX templates file location examples:
@pixelprodev
pixelprodev / wallaby.config.js
Created August 27, 2017 04:07
wallaby config
module.exports = function (wallaby) {
return {
files: [
{pattern: 'src/**/*.js'},
{pattern: 'src/**/*.jsx'},
{pattern: 'src/**/*.spec.js', ignore: true},
{pattern: 'src/**/*.json', instrument: false}
],
tests: [
@dschinkel
dschinkel / example-tests-wedotdd.js
Last active December 12, 2017 12:18
Example Tests from Private Repo for WeDoTDD.com
/*
Tools: mocha, chai-enzyme, jsdom, airbnb enzyme
Using WebStorm test runner and WebStorm to write code.
For the prod code, using Flow for type checking
These are isolated unit tests (not integration) that test behavior for particular React components
A big reason why I like React.js vs Vue, Angular, or other types of frameworks or
libraries is the simplicity at which you can test behavior. Also there's no magic going on here in terms of
@chengjianhua
chengjianhua / .setup.js
Created March 29, 2017 09:11
The setup for mocha test environment
import { jsdom } from 'jsdom';
import chai from 'chai';
import chaiEnzyme from 'chai-enzyme';
import { shallow, mount, render } from 'enzyme';
chai.use(chaiEnzyme());
global.should = chai.should();
global.shallow = shallow;
@graffic
graffic / gist:6c15f8c2b4f0f208939e
Created May 11, 2014 19:49
Uncle bob "Framework Whipped" original post

Framework Whipped

Uncle Bob 11 May 2014 Craftsmanship Frameworks are powerful tools. We'd be lost without them. But there's a cost to using them.

The relationship between a programmer and a framework is similar to the relationship between an executive and an administrative assistant. The framework takes care of all the necessary details, so that the executive can focus on high level decisions.

Think of Rails, or Spring, or JSF, or Hibernate. Think about what writing a web system would be like without these frameworks to help you. The idea is disheartening. There'd be so many little piddling details to deal with. It'd be like endeavoring to construct a mnemonic memory circuit using stone knives and bearskins[1].

And so we gleefully use those glittering frameworks. We joyously intermingle our code with the frameworks' in anticipation of all the benefits they promise. We make the mistake that so many executives have made before us. We marry our secretary.

@boxdot
boxdot / cli.elm
Last active July 24, 2018 20:47
Minimal console app in Elm
module Cli where
port output : String
port output =
"Sub-orbital table 8-bit realism boat soul-delay face forwards industrial
grade drone. Cartel towards footage tube assault table woman stimulate bridge
claymore mine semiotics human. Post-construct j-pop military-grade stimulate
narrative realism. Shoes convenience store sunglasses realism numinous tanto
long-chain hydrocarbons. Franchise tower render-farm girl wonton soup sprawl
fetishism Kowloon advert semiotics shoes dolphin drugs otaku marketing.
{--
Below shows some code commands that if entered into elm repl shows the output received
--}
import List
empty = ' '
markerX = 'X'
markerO = 'O'
gameNode = [ [ markerX, empty, empty ], [ markerO, markerO, empty ], [ markerX, empty, empty ]]
@sgdan
sgdan / DictIterators.elm
Created October 29, 2017 04:23
Iterating over a map in Elm
{--
Some Elm code for various ways to iterate over a map
Run at http://elm-lang.org:1234/try
--}
import Html exposing (text, div, br)
import Dict exposing (Dict)
import String exposing (toUpper)
@dschinkel
dschinkel / PlayingWithElmDictionaries.elm
Last active September 20, 2018 05:27
Elm - Dictionaries
-- instead of using a 2D list or 2D array to represent a game node/board, lets use a Dict instead
-- with Dict unlike List or Array, it's much easier to insert, find, and update values
{--
repl:
make sure you have no trailing spaces after \. Also, might need to uses spaces not tab in Sublime text
import Dict
board = Dict.fromList \
[ \