This file contains hidden or 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 ERR! Error: EROFS, symlink '../strip-ansi/cli.js' | |
| npm ERR! If you need help, you may report this log at: | |
| npm ERR! <http://github.com/isaacs/npm/issues> | |
| npm ERR! or email it to: | |
| npm ERR! <[email protected]> | |
| npm ERR! System Linux 3.13.0-32-generic | |
| npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" | |
| npm ERR! cwd /home/amr/Awingu/smc-ui | |
| npm ERR! node -v v0.10.25 |
This file contains hidden or 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
| goog.provide('sgo.manager.directives.port'); | |
| sgo.manager.directives.port = function() { | |
| function link(scope, element, attrs, ctrl) { | |
| var minPortValue = 0, | |
| maxPortValue = 65535; | |
| function validate(value) { | |
| var isValid = true; |
This file contains hidden or 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 func5() {} // depends on the results of async4() and | |
| function async4() {} // depends on the results of async3() and | |
| function async3() {} // depends on async2() | |
| function async2() {} // depends on async1() |
This file contains hidden or 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
| async1(function() { | |
| // do some stuff | |
| async2(function(inputsFromAsync1) { | |
| // do stuff that depends on inputsFromAsync1 | |
| async3(function(inputsFromAsync2) { | |
| // do stuff that depends on inputsFromAsync2 | |
| async4(function(inputsFromAsync3) { |
This file contains hidden or 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 asyncSayHiTo(name) { | |
| // define a defer | |
| // defer is the context of the ASYNC operation | |
| var defer = q.defer(); | |
| // make an async operation | |
| setTimeout(function() { | |
| // this should run after the function already terminated | |
| // and returned a promise | |
This file contains hidden or 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
| async1() | |
| .then(function(inputsFromAsync1) { | |
| return async2(); | |
| }) | |
| .then(function(inputsFromAsync2) { | |
| return async3(); | |
| }) | |
| .then(function(inputsFromAsync3) { | |
| return async4(); | |
| }) |
This file contains hidden or 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 asyncOperation() { | |
| // returns promise | |
| } | |
| var promises = []; | |
| for (var i=0; i<=10; i++) { | |
| var promise = asyncOperation(); | |
| promises.push(promise); | |
| } |
This file contains hidden or 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 asyncOperation() { | |
| // returns promise | |
| } | |
| // show blocking loading modal | |
| asyncOperation() | |
| .then(function() { | |
| // all fine | |
| }, function() { | |
| // something went wrong |
This file contains hidden or 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 uploadFile(data) { | |
| // we can send notification one or more time as following: | |
| defer.notify(percentageUploaded); | |
| // returns promise | |
| } | |
| uploadFile() | |
| .then(function() { | |
| // fine |
This file contains hidden or 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
| /* | |
| In case you have tens of files with '2 spaces' indentation that you need to convert to '4 spaces' | |
| 1. Install 'recursive-readdir-sync', do not add the --save label. | |
| 2. cd to the root of the directory you want to process | |
| 3. Place this script. | |
| 3. Run the script, commit, push, enjoy! | |
| */ | |
| let fs = require('fs'); | |
| let recursiveReadSync = require('recursive-readdir-sync'); |
OlderNewer