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
//Author - Narendra Sisodiya - http://narendrasisodiya.com | |
//WHeN to use ? when async result from One Element is needed in another. | |
var sequentialProcess = function(arr, callback){ | |
var pp = Promise.resolve(); | |
arr.forEach(function(v, i, A){ | |
pp = pp.then(function(){ | |
return callback(v, i, A); | |
}); |
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 numbers = [1,2,3,4,5]; | |
for(var i in numbers){ | |
(function(){ | |
var j = i; | |
setTimeout(function(){ | |
console.log(j); | |
}, 2000); | |
})(); | |
} |
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'; | |
var fs = require('fs'); | |
var request = require('request'); | |
var d = new Promise(function(resolve, reject){ | |
var result = []; | |
[1,2].forEach(function(item, index){ | |
request.post( | |
'your_comple_post_url', | |
{ form: { key: 'value'} },// These are body parameters |
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
For Italic | |
*text* OR _text_ | |
For Bold | |
**text** OR __text__ | |
For both italic and bold | |
**_text_** or you can do above multiple combinations | |
For headers | |
#text | |
##text | |
. |
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
Chrome Developer Tools: Search or navigate to files, methods or line numbers. Shortcuts for text search and beyond | |
The ability to quickly find or navigate to specific files, methods or line numbers in an web app can be important in your day to day workflow in the Chrome DevTools. Today we've got some useful tips to help with these when working in the Sources panel. | |
To search scripts, stylesheets and snippets by filename you can use: | |
* Ctrl + O (Windows) | |
* Cmd + O (Mac OSX) | |
To perform a text search within the current file you can use: |
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
app = angular.module('angularjs-starter', []) | |
app.controller 'MainCtrl', ($scope) -> | |
$scope.name = 'World' | |
angular.bootstrap(document, ['angularjs-starter']) |
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 script will copy all AQL user functions from the _system database of an ArangoDB server | |
// into all other databases of the server. Database names and authentication credentials must | |
// be specified in the script in the "databases" variable | |
// | |
// invoke the script from ArangoShell like this: | |
// require("internal").load("copy-aqlfunctions.js"); | |
(function () { | |
var db = require("org/arangodb").db; | |
var print = require("internal").print; |
NewerOlder