This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
'use strict'; | |
/* globals _*/ | |
/* - API access prettifier and standardizer | |
* we use this service heavily to take some of the pain out of writing api calls all the time. | |
* it wraps the native angular $http method. It'd be a simple task to write a non-angular specific | |
* version of this though. | |
* | |
* - Sample Usage: | |
* apiService.users(42).report(18).put({'sample': 'json'}).then(function(response){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
'use strict'; | |
/* globals _ */ | |
/* | |
* dismissable alert service | |
* - purpose | |
* this directive and service combo provide a reusable method of popping dismissable | |
* notifications for succesful submissions, errors, warnings, ad nauseam. | |
* | |
* - usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.dimensions = function () { | |
return _.chain(points) | |
.filter(function (item) { | |
if (item !== 'Z') { | |
return item; | |
} | |
}) | |
.map(function (point) { | |
var command = point[0]; | |
point = point.substr(1, point.length) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
'use strict'; | |
/* globals _ */ | |
angular.module('application') | |
.directive('dynamicDirectives', ['$compile', function ($compile) { | |
return { | |
restrict: 'A', | |
scope: true, | |
transclude: false, | |
link: function (scope, elem, attr) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//ip5: 86.9; | |
//ip6: 88.75; | |
//ip6p: 90.2; | |
.calc(@diff) { | |
.vhCalc(@input) { | |
@vh: (@input * @diff) / 100vh; | |
} | |
.calcHeader(@inpot) { | |
.vhCalc(@inpot); | |
@headerHeight: @vh; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"errorCode": 0, | |
"errorDesc": null, | |
"Header": { | |
"Key": { | |
"Type": "Attribute", | |
"Title": "FullName", | |
"Dimension": "Agent" | |
}, | |
"Value": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Services */ | |
var myApp = angular.module('myApp.services', []); | |
myApp.service('DB', function($window) { | |
//var query = 'SELECT DISTINCT(prod_category) FROM prod_master'; | |
var dbConn = $window.sqlitePlugin.openDatabase({ | |
name: "hd_app.sqlite" | |
}); | |
var chewer = function(tx, res, callback) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Header":{ | |
"Key":{ | |
"Type":"Attribute", | |
"Title":"BoardName", | |
"Dimension":"Broker" | |
}, | |
"Value":{ | |
"Key":{ | |
"Type":"Attribute", | |
"Title":"BrokerName", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var util = require('util'); | |
var fs = require('fs'); | |
var markov = require('markov'); | |
function theCleaner(theText) { | |
if (theText.slice(-1) !== ('!' || '?' || '.')) { | |
theText = theText.slice(0, theText.length - 1); | |
theText += '.'; | |
} |