Skip to content

Instantly share code, notes, and snippets.

public class when_I_roll_a_game_with_even_a_single_strike_and_try_to_roll_past_ten_frames : concerns<BowlingGame>
{
[Specification]
public void then_I_get_an_exception()
{
Assert.Throws<ApplicationException>(() =>
{
var game = build_up();
game.Roll(10);
9.times(() =>
@JogoShugh
JogoShugh / gist:00f07c8e7dce20bbb295
Last active August 29, 2015 14:05
Web API Design notes

Web APIs

  • Should be self-describing
  • Devs want to see examples quickly, not read for hours on end just to figure out basics
  • RPC -> REST -> HATEOAS
  • Avoid dogma of REST vs the world

URI Design

  • Start with nouns, not verbs

To run as a service on a Windows machine, do the following:

Assuming you have Git installed:

  • Open a Git Bash prompt.
  • Navigate to a folder where you would like to install the Requestor.
  • Type git clone https://github.com/versionone/VersionOne.Client.Requestor.git
  • Type cd VersionOne.Client.Requestor to change into the newly cloned repository directory.
  • Follow the steps in Configure for VersionOne Projects for editing the config.js and fields.js files to your needs.
  • Modify the package.json file such that the scripts property looks like this (simply prefixing node to the "start" sub-property):
@JogoShugh
JogoShugh / CS.md
Last active August 29, 2015 14:06

How to run CommitStream from scratch with commits from a source GitHub repo

This is a work in progress. As this evolves, we update this narrative.

Scenario

Given you have a GitHub repository that has commits matching the VersionOne asset mention pattern, like S-12345, D-00312, etc, and you want to start seeing those correlated with those assets inside VersionOne's asset detail view, then:

Install VersionOne with CommitStream loader build

  • Install a VersionOne build from ci-server/job/CommitStream-core-developing/
namespace VersionOne.Utility.Functional
open System.Net
open System
open System.IO
open Newtonsoft.Json
open Newtonsoft.Json.Linq
module Web =
@JogoShugh
JogoShugh / client_app.js
Created October 23, 2014 14:43
Meteor Team Order Selector
//client only code
Template.teams.teams = function () {
return Teams.find();
};
Template.teams.events({
'click .spin': function() {
Meteor.call('spin');
}
postDigest = (shouldBehaveThusly) ->
request(app).post("/api/digest", "myfirstdigest").end shouldBehaveThusly
getDigest = (path, shouldBehaveThusly) ->
request(app).get(path).end shouldBehaveThusly
chai = require("chai")
should = chai.should()
express = require("express")
app = express()
chai = require("chai")
sinon = require("sinon")
@JogoShugh
JogoShugh / test.coffee
Created December 12, 2014 22:22
JS vs Coffee for Test Code
chai = require("chai")
should = chai.should()
eventStoreEvnironment = require("./eventStoreEnvironment.js")
describe "projection digests-by-id", ->
data = require("./digests")
setEvents data.digests
require "../../projections/digests-by-id"
it "should partition into two streams", (done) ->
getStreamsInCategoryCount("digest-").should.equal 2
done()
@JogoShugh
JogoShugh / DHC import.json
Last active August 29, 2015 14:13
CommitStream sample commits
{
"version": 3,
"nodes": [
{
"id": "59CB3280-D4A9-4C64-82FE-F8FE8D080CBB",
"lastModified": "2015-01-15T08:57:07.558-05:00",
"name": "CommiStream",
"type": "Project"
},
{
var worldRows = [
'cegccccccccccccgcc',
'ctttttcccccctttttc',
'ctgccccccccccccgtc',
'ctttttcccccctttttc',
'ccccctccttcctccccc',
'cctcctccttcctcctcc',
'ccccctcccccctccccc',
'ctcccccccccccccctc',
'ctcttcttttttcttctc',