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
# Customize BASH PS1 prompt to show current GIT repository and branch. | |
# by Mike Stewart - http://MediaDoneRight.com | |
# SETUP CONSTANTS | |
# Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
# I don't remember where I found this. o_O | |
# Customized from http://mediadoneright.com/content/ultimate-git-ps1-bash-prompt | |
# Reset |
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
var HTTP = { | |
// SUCCESS | |
OK : 200, | |
CREATED : 201, | |
ACCEPTED : 202, | |
NO_CONTENT : 204, | |
// REDIRECTION | |
MOVED_PERMANENTLY : 301, | |
MOVED_TEMPORARY : 302, |
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
# declare new submodule | |
~/projets/dashboard$ git submodule add [email protected]:PredicSis/ui.git app/styles/ui | |
# Install a project with a submodule already defined | |
~/projets$ git clone [email protected]:yllieth/dashboard.git | |
~/projets/dashboard$ git submodule init | |
~/projets/dashboard$ git submodule update |
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({ |
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('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
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 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
// 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
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'); | |
} |
OlderNewer