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
'use strict'; | |
let merge = function (){ | |
let _obj = {}; | |
const argv = Array.prototype.slice.call(arguments); | |
argv.map(function(item){ | |
const key = Object.keys(item); | |
key.map(function(newKey){ | |
Object.defineProperty(_obj, newKey, { | |
value: item[newKey], |
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
'use strict'; | |
const microo = require('../lib/microo'); | |
let microoApp = microo((err, res) => { | |
if (err) { throw err; } | |
console.log(res); | |
}); | |
/*****************************************************************/ | |
// Example 1 |
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
.directive('imageSwap', [function() { | |
return { | |
restrict: 'EA', | |
link: function(scope, elem, attrs, ctrl) { | |
var profileMainImage = []; | |
var innerHtml = attrs.src; | |
var id = attrs.id; | |
if (id) { | |
elem.bind('click', function() { | |
profileMainImage['alt'] = attrs.videoUrl; |
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
app.directive('imageExists', ['$http', 'IMAGE', | |
function($http, IMAGE) { | |
return { | |
restrict: 'EA', | |
link: function(scope, elem, attrs, ctrl) { | |
$http({ | |
method: "GET", | |
url: attrs.src || attrs.ngSrc | |
}).then(function mySuccess(response) { |
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
app.directive('scrollToTop', function() { | |
return { | |
restrict: 'EA', | |
scope: { setFn: '&' }, | |
link: function(scope, elem, attrs, ctrl) { | |
scope.$on('scroll', function(event) { | |
elem[0].scrollTop = elem[0].scrollHeight; | |
}) | |
} | |
} |
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
function array_chunk(array, chunkSize) { | |
return [].concat.apply([], | |
array.map(function(elem, i) { | |
return i % chunkSize ? [] : [array.slice(i, i + chunkSize)]; | |
}) | |
); | |
} |
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
/* | |
Input | |
======== | |
{ | |
empireHero:{ | |
name | |
} | |
jediHero:{ | |
name | |
} |
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
var wordList = []; | |
const alp = 'abcdefghijklmnopqrstuvwxyz'.split(''); | |
const alpSymNum = alp.join('').concat('!@#$%^&*_+~0123456789'); | |
var countryJson = [ | |
{"name":"Israel","dial_code":"+972","code":"IL"}, | |
{"name":"Afghanistan","dial_code":"+93","code":"AF"}, | |
{"name":"Albania","dial_code":"+355","code":"AL"}, | |
{"name":"Algeria","dial_code":"+213","code":"DZ"}, | |
{"name":"AmericanSamoa","dial_code":"+1 684","code":"AS"}, |
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
var wordList = []; | |
var alp = 'abcdefghijklmnopqrstuvwxyz'.split(''); | |
var alpSymNum = alp.join('').concat('!@#$%^&*_+~0123456789'); | |
var nameSet =[ | |
"abandoned","able","absolute","adorable","adventurous","academic","acceptable","acclaimed","accomplished", | |
"accurate","aching","acidic","acrobatic","active","actual","adept","admirable","admired","adolescent", | |
"adorable","adored","advanced","afraid","affectionate","aged","aggravating","aggressive","agile","agitated", | |
"agonizing","agreeable","ajar","alarmed","alarming","alert","alienated","alive","all","altruistic","amazing", | |
"ambitious","ample","amused","amusing","anchored","ancient","angelic","angry","anguished","animated","annual", |
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
function filterJsonData(data,rules,take,callback){ | |
var i = 0; | |
var _data = data; | |
var _newDataSet = []; | |
take = (take == undefined) ? _data.length : take; | |
while(i < take){ | |
Object.keys(_data[i]).forEach(function(ele){ | |
(rules.indexOf(ele) === -1) ? delete _data[i][ele] : false; |