Wednesday, 28 February 2018
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
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 branch -m new-name
https://multiplestates.wordpress.com/2015/02/05/rename-a-local-and-remote-branch-in-git/
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 namegit branch -m new-name
If you are on a different branch:
1
| git branch -m old-name new-name |
Thursday, 22 February 2018
Tuesday, 20 February 2018
replace a string with other string
var somestring = "foo is an awesome foo bar foo foo"; //somestring lowercase
var replaced = somestring.replace(/foo/g, "bar").replace(/is/g, "or");
alert(replaced);
var replaced = somestring.replace(/foo/g, "bar").replace(/is/g, "or");
alert(replaced);
Monday, 19 February 2018
Friday, 16 February 2018
Thursday, 15 February 2018
Wednesday, 14 February 2018
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
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
Thursday, 8 February 2018
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();
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();
Monday, 5 February 2018
Sunday, 4 February 2018
Friday, 2 February 2018
Subscribe to:
Posts (Atom)