Codility efficient algorithm solutions in JavaScript

This post aim is to provide Codility algorithm solutions in JavaScript as there are so many of them available out there. I am not pretending to have the best algorithm possible but at least the following answers scored 100% on Codility test result.

I created this article to prepare for Toptal interview process . If you wish to apply to Toptal , here is a referral link that will link your account to mine if you are successful!

10 minutes to read

AngularJS memory stats

If you are familiar with AngularJS development, you know that memory consumption is one of the highest challenge you must face using it. angular-memory-stats is a module that helps you with this very problematic!
One minute to read

D3.js Responsive Word Cloud

There are few examples of word cloud using D3js, the best known is the one from Jason Davies but the code is difficult to understand as it is coupled with the cloud form (angle, number of words etc) and has many functions.
One minute to read

AngularJs, Browserify Polymer and Sass boilerplate

Source available on Github : https://github.com/shprink/angularjs-browserify-polymer-boilerplate

Two way data biding

Using Polymer and AngularJs at the same time is a bit problematic. The two way data biding (AngularJs feature) cannot natively work with Polimer web components. Some project are emerging though:

Those projects are not mature enought to use, so I decided to directly use AngularJs's resources within Polymer elements.

Using AngularJs's services within Polymer

var userService = angular.injector(['boilerplate']).get('UserService');

Polymer('user-list', {
    ready: function() {
        this.list = userService.getList();
    },
    tapAction: function(e) {
        console.log('tap', e);
    }
});

Using AngularJs's scope within Polymer

Polymer('boilerplate-login', {
    ready: function() {
        this.angularScope = angular.element(this).scope();
    },
    sendForm: function(){
        this.angularScope.goToHome();
    }
});
One minute to read

Introduction to Gulp.js with practical examples

Gulp.js is what we call a JavaScript Task Runner, it is Open Source and available on GitHub. It helps you automate repetitive tasks such as minification, compilation, unit testing, linting, etc. Gulp.js does not revolutionize automation but simplifies it tremendously.
6 minutes to read