(function(angular){
    'use strict';
    var app = angular.module('dashboard.controllers', []);

    app.controller('DashboardCtrl', ['$scope', 'CourseStudent',
        function ($scope, CourseStudent) {
            $scope.my_courses = CourseStudent.query();
//            $scope.my_courses.$promise.then(function(res){
//                var rows = [],
//                    row = [],
//                    n = 0,
//                    i = 0;
//                var sorted = res.sort(function(a,b){
//                        return b.percent_progress-a.percent_progress; // ordering by percentage
//                });
//                console.log(sorted)
//                for(var i = 0; i<sorted.length;i++){ // keeping courses in pairs for layout purposes
//                    if(i == 6) {
//                        break;
//                    }
//                    if(n < 2) {
//                        row.push(sorted[i]);
//                        n++;
//                    }
//                    else {
//                        rows.push(row);
//                        row = [];
//                        n=0;
//                    }
//                };
//                $scope.courses_rows = rows;
//            });
        }
    ]);

})(window.angular);
@@ -257,983 +257,8 @@
 ();%0A
-//            $scope.my_courses.$promise.then(function(res)%7B%0A//                var rows = %5B%5D,%0A//                    row = %5B%5D,%0A//                    n = 0,%0A//                    i = 0;%0A//                var sorted = res.sort(function(a,b)%7B%0A//                        return b.percent_progress-a.percent_progress; // ordering by percentage%0A//                %7D);%0A//                console.log(sorted)%0A//                for(var i = 0; i%3Csorted.length;i++)%7B // keeping courses in pairs for layout purposes%0A//                    if(i == 6) %7B%0A//                        break;%0A//                    %7D%0A//                    if(n %3C 2) %7B%0A//                        row.push(sorted%5Bi%5D);%0A//                        n++;%0A//                    %7D%0A//                    else %7B%0A//                        rows.push(row);%0A//                        row = %5B%5D;%0A//                        n=0;%0A//                    %7D%0A//                %7D;%0A//                $scope.courses_rows = rows;%0A//            %7D);%0A
     

remove commented code