Skip to content

Instantly share code, notes, and snippets.

View BrockFredin's full-sized avatar

Brock Fredin BrockFredin

  • Minneapolis, MN
View GitHub Profile
[ResponseType(typeof(IEnumerable<Example>))]
[HttpGet]
[Authorize]
public async Task<IHttpActionResult> Foo()
[ResponseType(typeof(string))]
[HttpPost]
[Authorize]
public async Task<IHttpActionResult> Bar(string selected)
http://www.zealake.com/2014/01/01/unit-test-your-angularjs-views/
http://stackoverflow.com/questions/16022180/testing-whether-certain-elements-are-visible-or-not
ralph
https://github.com/flowjs/ng-flow/issues/86
Count: <span class="header-cart-count js-headerItemCount">11</span>
decrement: $('.header-cart-count').value--;
Requirement: Parse to Int and decrement count when cart count changes
var count = $('.header-cart-count').text(); //gets text for count
var countInt = parseInt(count); //casts count to int
var countTotal = countInt - 1; //decrements
console.log(countTotal);
________________$$$$
______________$$____$$
______________$$____$$
______________$$____$$
______________$$____$$
______________$$____$$
__________$$$$$$____$$$$$$
________$$____$$____$$____$$$$
________$$____$$____$$____$$__$$
$$$$$$__$$____$$____$$____$$____$$
/**
* GET - All Mail Received
* @param req
* @param res
* @param next
*/
allMailReceived: function (req, res, next) {
var user = req.param('username');
Mail.find({to : user}, function (error, data) {
// want to abstract this so that 'moddule.exports.addride' has ONE SINGLE RESPONSIBILITY.
module.exports.addRide = function (rideData, callback) {
var newRide = new ridesModel();
async.forEach(rideData), function (item, callback) {
if(typeof item == "undefined") {
item === "";
console.log(item + " missing property"); // print the missing property
exports.create = function (req, res, next) {
var data = {
startLatitude: req.body.startLatitude,
startLongitude: req.body.startLongitude,
endLatitude: req.body.endLatitude,
endLongitude: req.body.endLongitude,
amount: req.body.amount,
requestId: req.body.requestId,
status: req.body.status,
Summary:
Created new backendRefactor branch, reviewed GET /venues endpoint, extracted searching captions, wrote a single function for pushLocationIdsToFilteredArray, and a corresponding iniital unit test.
1. line 95 - 175: searching captions refactor
A. Taking entire function and putting into a single function.
B. Adding a single object "venueModel" which can add properties
C. Taking venueModel.pushLocationIdsToFilteredArray and extracting to single function
D. Writing a Jasmine test for venueModel.pushLocationIdsToFilteredArray
ko.validation.rules["noSpecialChars"] = {
validator: function (value) {
var regExp = new RegExp("^[/a-z0-9 '.,#%$!()+@!-s-]*", "i");
return !regExp.test(value);
},
message: "only letters, numbers, space, comma, dot, pound(#), hyphen(-) or forward slash(/) are accepted."
};
TEST
------
/**
* Created by brock.fredin on 3/5/15.
*/
'use strict';
describe('UserListViewCtrl', function(){
var scope;//we'll use this scope in our tests
//mock Application to allow us to inject our own dependencies
beforeEach(angular.mock.module('Allday'));