This file contains 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
export {}; | |
function findClosestNumber(arr: number[], target: number): number { | |
// Sort the array in ascending order | |
arr.sort((a, b) => a - b); | |
let closest: number = arr[0]; | |
let minDifference: number = Math.abs(target - closest); | |
arr.forEach((num) => { |
This file contains 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
# built application files | |
*.apk | |
*.ap_ | |
# files for the dex VM | |
*.dex | |
# Java class files | |
*.class |
This file contains 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
//this is json array that MongoDB will easier read and import into it | |
//for the record if you didn't use json array MongoDB will read data per line so don't forget to re-format it | |
[ | |
{ name: "Widget 1", desc: "This is Widget 1" }, | |
{ name: "Widget 2", desc: "This is Widget 2" } | |
] |
This file contains 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
clean: { | |
dist: { | |
files: [{ | |
dot: true, | |
src: [ | |
'.tmp', | |
'<%= yeoman.dist %>/*', | |
'!<%= yeoman.dist %>/.git*' | |
] | |
}] |
This file contains 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
//add this config to karma-e2e.conf.js | |
// Uncomment the following lines if you are using grunt's server to run the tests | |
proxies = { | |
'/': 'http://localhost:9000/' | |
}; | |
// URL root prevent conflicts with the site root | |
urlRoot = '_karma_'; |
This file contains 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
ngtemplates: { | |
myApp: { | |
options: { | |
base: 'app/templates', // $templateCache ID will be relative to this folder | |
prepend: 'templates/', // path to your templates files ( this will add path to it ) | |
module: { | |
name: 'myAppTemplate', // (Optional) Explicitly define module name | |
define: true // (Optional) Define new module (Default: false) | |
} | |
}, |
This file contains 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'; | |
angular.module('angularApp') | |
.controller('MainCtrl', function ($scope, $rootScope, loadConfig) { | |
//services dependecies ( should be mock ) | |
$scope.loadConfig = loadConfig.getConfig('main', $rootScope.lang); | |
//function change route | |
$scope.createRoute = function(link) { |
This file contains 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
angular.module('angularApp') | |
.factory('loadConfig', function($http) { | |
return { | |
getPageInfo : function(page) { | |
return $http.get('configurations/en/' + page + '.json').then( | |
function(response) { | |
return response.data; | |
}); | |
} |
This file contains 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
npm remove -g yo generator-* yeoman-generator | |
npm install -g yo generator-angular |
This file contains 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
replace: { | |
local:{ | |
options:{ | |
variables:{ | |
'host':'http://localhost' | |
}, | |
prefix: '@@' | |
}, | |
files: [ | |
{src: ['app/scripts/services/services.js'], dest: 'app/scripts/prod/services/services.js'} |