This file contains hidden or 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
| define([],function(){ | |
| var messages = { | |
| 'login': { | |
| 201: 'Email already taken', | |
| 400: 'Bad request', | |
| 503: 'The server is currently unavailable.' | |
| } | |
| }; | |
| return { | |
| getMessage : function(prefix,statusCode) { |
This file contains hidden or 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://a5hik.github.io/ng-sortable/#/sprint, https://github.com/a5hik/ng-sortable | |
| https://github.com/angular-ui/ui-sortable/blob/master/demo/demo.js |
This file contains hidden or 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
| https://github.com/Atmosphere/atmosphere-samples/ |
This file contains hidden or 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
| // Permissions.js | |
| canAddFields: function(){ | |
| var returnVal = this.checkPermissions('isNotExternalUser','hasAddFieldsAccess'); | |
| return returnVal; | |
| }, | |
| checkPermissions : function() { | |
| var args = _.toArray(arguments); | |
| var returnargs = _(args).every(lang.hitch(this, function(propName) { | |
| return this[propName].bind(this).call(); |
This file contains hidden or 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
| // test for resolve | |
| it('Should set isValid flag when user is not member of organization', function(done) { | |
| var param = { | |
| username: "sanketteam", | |
| userId: 42808, | |
| switchedOrgId: 7607 //[email protected] | |
| } | |
| var promise = usermanagement.checkOrganization(param); // returns a promise and uses the service code to return it | |
| // this will be in case of resolve |
This file contains hidden or 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
| Below is the jsperf test which creates instances when methods are defined inside constructor methods vs in prototype object. | |
| Methods defined in prototype object is faster as each instance shares the same prototype object thats with the constructor function. | |
| http://jsperf.com/prototype-vs-constructor-methods |
This file contains hidden or 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
| // code has been copied from http://rosettacode.org/wiki/Levenshtein_distance#Java | |
| package main.java; | |
| public class Levenstein { | |
| public static int distance(String a, String b) { | |
| a = a.toLowerCase(); | |
| b = b.toLowerCase(); | |
| // i == 0 |
This file contains hidden or 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://thatjsdude.com/interview/js2.html | |
| http://code.tutsplus.com/articles/master-developers-addy-osmani--net-31661 |
This file contains hidden or 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
| JSFiddle demonstrating the isolated scopes | |
| http://jsfiddle.net/juanmendez/k6chmnch/ |
This file contains hidden or 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
| Promise.map(emailParams,function(emailParam) { | |
| logger.info('sending email to sendmail for %j', emailParam, {}); | |
| var host = "www.example.com/"; | |
| var html = jadeS.renderFile(template, { | |
| farms: emailParam.farms, | |
| headerImage: "image", | |
| heading: emailParam.heading, | |
| fieldFocusUrl: "someurl", | |
| host: host | |
| }); |
OlderNewer