Tuesday, 27 February 2018

git commands

git add --all
git commit -m"message"
git push

git add 
git stash
git checkout branch
git stash pop
then move to the required branch and fire git stash pop.
git rebase

git rebase develop then put your branch name.



https://stackoverflow.com/questions/1783405/how-do-i-check-out-a-remote-git-branch
git fetch
git checkout test
Rename local branch name

git branch -m new-name

If you are on a different branch:
1
git branch -m old-name new-name
https://multiplestates.wordpress.com/2015/02/05/rename-a-local-and-remote-branch-in-git/

Thursday, 22 February 2018

git tutorial

https://rubygarage.org/blog/most-basic-git-commands-with-examples

Tuesday, 13 February 2018

node upgrade and downgrade version

sudo npm cache clean -f
sudo npm install -g n
sudo n 4.3.2

Nodejs tutorial

sudo npm cache clean -f
sudo npm install -g n
sudo n 6.11.5

Wednesday, 7 February 2018

promise example

//let Promise=require("bluebird");
let fs=require("fs");
let fileName=['a.text','b.text','c.text','d.text','e.text','f.text'];
let encryption=require("./encryptDecrypt");
console.log("pawan kumar");
let i=0;
// Promise.map(fileName, function(fileName) {
//   i++;
// return new Promise(function(resolve,reject){
//   encryption.encryptItme(i).then(function(data){
//       console.log(data);
//       //return data;
//       resolve(data);
//     });
// })
// }).then(function(){
//   console.log("done pawan");
// })

// fileName.map(function(data){
//   i++;
//   let mydat;
//    mydat =encryption.encryptItme(i).then(function(data){
//         console.log(data);
//         //return data;
//       //  return data;
//       });
//       Promise.all([mydat]).then(function(data){
//         console.log("--go--");
//       })
// })
//   let mydat=[];
// fileName.map(function(data){
// i++;
//      mydat.push(encryption.encryptItme(i).then(function(data){
//           console.log(data);
//           //return data;
//         //  return data;
//       }));
//
// })
// Promise.all(mydat).then(function(data){
//         console.log("--go--");
//       })
// mydat =encryption.encryptItme(i).then(function(data){
//         console.log(data);
//         return data;
//       //  return data;
//       });
//       Promise.all([mydat]).then(function(data){
//         console.log("--go--",data);
//       });
// new Promise(function(resolve, reject) {
//
//   setTimeout(() => resolve(1), 1000);
//
// }).then(function(result) {
//
//   console.log("pawan",result); // 1
//
//   // return new Promise((resolve, reject) => { // (*)
//   //   setTimeout(() => resolve(result * 2), 1000);
//   // });
//   return mydat =encryption.encryptItme(i).then(function(data){
//           console.log(data);
//           return data;
//         });
//
// }).then(function(result) { // (**)
//
//   console.log("kumar",result); // 2
//
//   // return new Promise((resolve, reject) => {
//   //
//   //   setTimeout(function(){
//   //      console.log("uioo");
//   //    resolve(result * 2)
//   //
//   //   }, 50000);
//     // mydat =encryption.encryptItme(i).then(function(data){
//     //       console.log(data);
//     //       return data;
//     //     });
//
//
//           setTimeout(function(){
//              console.log("uioo");
//           //resolve(result * 2)
//
//         }, 5000);
// }).promise().then(function(result) {
//
//   console.log("yadaw",result); // 4
//
// });


// var request = require("request");
// var userDetails;
//
// function initialize() {
//     // Setting URL and headers for request
//     var options = {
//         url: 'https://api.github.com/users/narenaryan',
//         headers: {
//             'User-Agent': 'request'
//         }
//     };
//     // Return new promise
//     return new Promise(function(resolve, reject) {
//     // Do async job
//         request.get(options, function(err, resp, body) {
//             if (err) {
//                 reject(err);
//             } else {
//                 resolve(JSON.parse(body));
//             }
//         })
//     })
//
// }
//
// function main() {
//     var initializePromise = initialize();
//     initializePromise.then(function(result) {
//         userDetails = result;
//         console.log("Initialized user details");
//         // Use user details from here
//         console.log(userDetails)
//     }, function(err) {
//         console.log(err);
//     })
// }
//
// main();

Async module link

Friday, 2 February 2018