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
[ResponseType(typeof(IEnumerable<Example>))] | |
[HttpGet] | |
[Authorize] | |
public async Task<IHttpActionResult> Foo() | |
[ResponseType(typeof(string))] | |
[HttpPost] | |
[Authorize] | |
public async Task<IHttpActionResult> Bar(string selected) |
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
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 | |
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
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); |
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 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
/** | |
* 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) { |
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
// 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 |
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
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, |
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
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 |
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
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 | |
------ |
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
/** | |
* 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')); |
NewerOlder