Skip to content

Instantly share code, notes, and snippets.

@FrankHassanabad
Created October 2, 2015 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FrankHassanabad/9e935d4e518ddc69f9c5 to your computer and use it in GitHub Desktop.
Save FrankHassanabad/9e935d4e518ddc69f9c5 to your computer and use it in GitHub Desktop.
Stack ramblings
* Download Atom Editor and install it
* Go to packages to install a package and install
- git-plus
- last-cursor-position
- line-diff-details
- linter
- linter-eslint
- merge-conflicts
- preview
* Go to eslint to see how it works
- http://eslint.org/
* Install NodeJS 4.0.0
* Init a new project through
- node init
* Then install eslint through
- npm install --save-dev eslint
Now use Atom to create a few things like promises through say Q library
- npm install --save-dev Q
atom app.js and add something like this for play:
'use strict';
const Q = require('q');
function getInputPromise() {
return Q.fcall(function() {
return 10;
});
}
getInputPromise().then(function(value) {
console.log('value 1 is: %s', value);
//throw new TypeError('Value 1 error');
//return value * 2;
})
.then(function(value) {
console.log('value 2 is %s', value);
//throw new TypeError('Value 2 error');
//return value * 3;
}, function(failure){
console.log('I have encountered a failure %s', failure);
})
.fin(function() {
console.log ('fin from up top');
})
.done();
@ltullman
Copy link

Line 17 should be npm init. Otherwise, nice preview of promises in Q. Thanks for the gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment