Skip to content

Instantly share code, notes, and snippets.

@JogoShugh
JogoShugh / gist:4637576
Last active December 11, 2015 17:49
Use Backbone.js, Backbone Forms, and the VersionOne Data API to create a 75-line agile user story editor.
var StoryFormSchema = { // Backbone.Form will generate an HTML form based on this schema
Name: { validators: ['required'] }, // Name is required
Description: 'TextArea', // Since these next three are not required, we only need the data type
Benefits: 'TextArea',
Estimate: 'Number',
RequestedBy: {} // Defaults to 'Text'
};
var storyForm = null; // Instance of the schema declared above, created when we click 'Load Story'
var urlRoot = 'http://eval.versionone.net/platformtest/rest-1.v1/Data/Story/'; // V1 API URL base
@JogoShugh
JogoShugh / gist:4684567
Last active December 12, 2015 00:29
Understand How and Why REST APIs Work
{
"Name": "Tutorial Story",
"Description": "Great description",
"Estimate": "5"
}
@JogoShugh
JogoShugh / gist:4684780
Last active December 12, 2015 00:38
How to use jQuery to GET a User Story
<div id="error">
<h1>Error During AJAX Call:</h1>
<br />
<hr />
<br />
<p id="errorMessage">
</p>
</div>
<div id="success">
@JogoShugh
JogoShugh / gist:4685001
Created January 31, 2013 18:21
How To Build a Barebones User Story Editor with jQuery and the VersionOne REST Data API
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Barebones Story Editor</title>
</head>
<body>
<h1>Barebones Story Editor</h1><br>
<label for="StoryId">Enter a Story ID:</label>
@JogoShugh
JogoShugh / gist:4685074
Last active December 12, 2015 00:38
Understand the How the Barebones User Story Editor Works
$(function () {
var storyId = '';
$("#storyGet").click(function (e) {
storyId = $('#StoryId').val();
if (storyId == '') {
return;
}
var storyUrl = url + storyId + select
$.ajax({
url: storyUrl,
@JogoShugh
JogoShugh / gist:4685389
Last active December 12, 2015 00:39
How to Build a Backbone-fortified User Story Editor for the VersionOne REST Data API
<html>
<head>
<title>Backbone-Fortified VersionOne Story Editor</title>
</head>
<body>
<h1>Backbone-Fortified VersionOne Story Editor</h1>
<div id="editor">
<form id="editorForm">
<h4>Story Details</h4>
<hr />
@JogoShugh
JogoShugh / gist:4685990
Last active December 12, 2015 00:48
VersionOne MetaMorformzr
{
"Story.Name": {
"_type": "AttributeDefinition",
"Name": "Name",
"Token": "Story.Name",
"DisplayName": "AttributeDefinition'Name'Story",
"AttributeType": "Text",
"IsReadOnly": false,
"IsRequired": true,
"IsMultivalue": false,
@JogoShugh
JogoShugh / gist:4686674
Last active December 12, 2015 00:49
OpenEpi Module
define ['../modules/outputBuilder'], (outputBuilder) ->
name:'ConfidenceInterval',
group:'Continuous Variables',
title: 'Confidence Interval',
titleShort: 'Median / %ile CI',
summary: 'Confidence Interval of median or other percentile for a sample size',
description: "This module calculates confidence interval around a selected percentile for
a sample size given. Entering sample size and desired percentile will calculate
95% confidence interval as a default confidence limit. The user can change the
confidence interval by typing in new value. Please note that the selected percentile
@JogoShugh
JogoShugh / gist:4687639
Last active December 12, 2015 00:58
Just for Fun: CoffeeScript samples
loadMeta = (callback) ->
formSchema = {}
attributes = getSelectedAttributesNames()
$.ajax(metaUrl).done (data) ->
titleRequests = []
attributeNames = _.map(attributes, (fieldName) ->
"Story." + fieldName
)
attribs = _.pick(data.Attributes, attributeNames)
_.each attribs, (item, index) ->
@JogoShugh
JogoShugh / gist:4689117
Last active December 12, 2015 01:08
Backbone Forms Model Binding
<!-- Seriously, this is it: -->
<html>
<body></body>
</html>