Skip to content

Instantly share code, notes, and snippets.

View jeson114's full-sized avatar

Jeson Dias jeson114

View GitHub Profile
function handleRateCardToggle() {
if (deal.ratecard.msa.enabled === false) {2
var allRoles = [];
if (isRateCardActive()) {
deal.scenarios.items.forEach(getRoles);
var message = 'You have scenarios that use rate cards. If you disable the customer rate card switch all roles from this rate card will be deleted from this deal.';
console.log(message);
SharedState.set('confirmMessage', message);
SharedState.set('confirmAction', function() {
var activeRateCards = deal.ratecard.list.filter(function(item) {
@jeson114
jeson114 / ObjectAnalysisService.js
Last active November 3, 2017 08:11
Recommendation for an object evaluator against a set of rules
//rules: array of objects
////schema : [{fn:somefucnctionDefinition] applies to evaluate()
//schema : [{fn:somefucnctionDefinition,key:bool}] applies only to every and some
//evaluate every - checks for all rules to pass
//evaluate some - checks for atleast one rule to pass
//rule must be a function whose execution results in a truthy or falsy value
//key is set on target as the result of a the evaluate function . the key to be set needs to be passed in rule.key
(function() {
@jeson114
jeson114 / framework-sizes.md
Created July 4, 2017 05:25 — forked from Restuta/framework-sizes.md
Sizes of JS frameworks, just minified + minified and gzipped, (React, Angular 2, Vue, Ember)

Below is the list of modern JS frameworks and almost frameworks – Angular, Ember and React.

All files were downloaded from https://cdnjs.com and named accordingly. Output from ls command is stripped out (irrelevant stuff)

As-is (minified)

$ ls -lhS
566K Jan 4 22:03 angular2.min.js