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
const cleanGeneratedFilesBasedOn = (mapFileExtension, sourceFileExtension, otherExtensionsToDelete) => { | |
const debug = true; | |
const startTime = new Date().getTime(); | |
if (!Array.isArray(otherExtensionsToDelete)) { | |
otherExtensionsToDelete = []; | |
} | |
const pattern = '{,!(node_modules)/**/}*' + mapFileExtension; | |
return glob(pattern, (err, files) => { | |
let toDelete = []; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<div id="page"> | |
<div id="nav-top-bar">topbar</div> |
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
// returns elements not ends | |
function elementsNotEndsBy(ending, array) { | |
var regex = new RegExp(ending + '$'); | |
return array.filter(entry => !regex.test(entry)); | |
} | |
elementsNotEndsBy('berry', ['strawberry', 'apple', 'blueberry']); // => ['apple'] | |
elementsNotEndsBy('allEntries', ['strawberry', 'apple', 'blueberry']); // => ['strawberry', 'apple', 'blueberry'] | |
elementsNotEndsBy('allEntries', []); // => [] |
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
function fn1(previous) { | |
console.log('previous: ' + previous, 'current: step1'); | |
return Promise.resolve('step1'); | |
} | |
function fn2(previous) { | |
console.log('previous: ' + previous, 'current: step2'); | |
return Promise.reject('step2'); | |
} |
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
// A row with fixed height, background-color and text-color. Useful to create topbars of footers | |
@mixin banner($bg: $body-background, $color: $body-font-color, $height: $banner-height) { | |
height: $height; | |
line-height: $height; | |
background-color: $bg; | |
color: $color; | |
}; | |
// Fine positionning mixin. Useful to align rebellious elements | |
@mixin offset($size, $origin: top) { |
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 version | |
angular | |
.module('predicsis.tools.urlParser') | |
.factory('urlParser', function () { | |
function urlParser(url) { | |
var parser = document.createElement('a'), searchObject = {}, queries, split, i; | |
// Let the browser do the work | |
parser.href = url; |
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
sudo apt-get install graphviz | |
npm install grunt-angular-modules-graph --save-dev | |
npm install grunt-graphviz --save-dev |
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('myHubApp', [...]) | |
.factory('apiRestangular', function(Restangular, baseUrl) { | |
return Restangular.withConfig(function(RestangularConfigurer) { | |
RestangularConfigurer.setBaseUrl(baseUrl.API); | |
}); | |
}) | |
.factory('api', function(apiRestangular) { | |
return { | |
one: function(resource, id) { |
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('tools.filter') | |
.filter('extension', function() { | |
return function(input) { | |
return input.split('.').pop() | |
}; | |
}); |
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("hub.upload") | |
.directive("fineUploaderS3", function($compile, $interpolate, $translate, baseUrl) { | |
return { | |
restrict: "A", | |
replace: true, | |
link: function($scope, element, attrs) { | |
var wrapper = document.getElementById("upload-s3") | |
new qq.s3.FineUploader({ |
NewerOlder