Skip to content

Instantly share code, notes, and snippets.

View byronferguson's full-sized avatar

Byron Ferguson byronferguson

View GitHub Profile
@byronferguson
byronferguson / apiFactory.js
Last active September 4, 2015 19:46
Work in progress: attempting to create a simple REST interface object
(function(global, $) {
var ccREST = function(studentID, institutionID, clusterID) {
return new ccREST.init(studentID, institutionID, clusterID);
};
var BASE_API_URL = '/api/v1/index.cfm';
var createResponsePackage = function(clusterID) {
clusterID = clusterID || 0;
@byronferguson
byronferguson / gist:b297d74cdb5830114528
Created August 12, 2015 16:41
AngularJS Factory not found
app.factory('InterviewPageFactory', function($http, URL) {
var getData = function(pageID) {
return $http.get(URL + 'interviews/page/' + pageID);
}
return {
getData: getData
};
});
<div class="form-group">
<label for="schoolLevel">Which school are you currently attending?</label>
<select name="schoolLevel" id="schoolLevel" class="form-control">
<option value="0"></option>
<option value="1">High School</option>
<option value="2">Home School</option>
<option value="3">2yr College</option>
<option value="4">4yr College</option>
<option value="5">Other</option>
<option value="6">Not Attending</option>
var pageInfo = [];
var questionInfo = {};
// Loop over the questions to fill in the other aspects (options / responses)
for(var record in local.results) {
structClear(local.questionInfo);
structInsert(local.questionInfo, "question", record);
structInsert(local.questionInfo, "options", record.qID);
structInsert(local.questionInfo, "responses", 1);
@byronferguson
byronferguson / Interview
Created July 8, 2015 18:58
General Interview Design
SQL: grab questions for page
CF:
NavBar
Sidebar
Body/Content
Loop(questions) {
Module(options) {}
}
Next Page