pm2 start --name "dev react" --time npm -- start
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
#!/bin/bash | |
## Author : Jasti Sri Radhe Shyam (https://jastisriradheshyam.github.io) | |
function printHelp() { | |
cat <<EOL | |
Usage: | |
npm_login.sh [Flags] | |
Flags: | |
-h print help |
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
Promise.allSettled = function (promises) { | |
const mappedPromises = promises.map(promise => ( | |
promise | |
.then(value => ({ status: 'fulfilled', value })) | |
.catch(reason => ({ status: 'rejected', reason })) | |
)); | |
return Promise.all(mappedPromises); | |
}; |
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
const path = require('path'); | |
// here after the dirname just make it to the root path of your choice | |
// all the path.resolve() will resolve from the process current directrory | |
// and chdir change that directory | |
const val = path.resolve(path.dirname(require.main.filename)+"/../..") | |
process.chdir(val); | |
/* | |
use case: |
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
// node.js error object to string | |
const util = require('util') | |
var fullErrorObjectString = ""; | |
try { | |
k++ | |
} catch (error) { | |
console.log(util.inspect(error, false, null, false /* enable colors */)) | |
fullErrorObjectString = util.inspect(error, false, null, false /* enable colors */).toString() | |
} |
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 pool = require('./connection'); | |
const mysql = require('mysql'); | |
/** | |
* Executes SQL query and returns data. | |
* @constructor | |
* @param {string} queryText - SQL query string. | |
*/ |
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
// response for error handling | |
let response = { | |
success: Boolean, | |
errorType: Number, // 1 - Programmer or config, 2 - Operational | |
responseCode: String, | |
message: String | |
}; |
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
const nodeRSA = require('node-rsa'); | |
/** | |
* return the decrypted Data (RSA OAEP Encryption) | |
* @param {string} RSAPrivateKey | |
* @param {string} EncrypteDataBuffer | |
* @returns {string} Data decrypted data | |
*/ | |
var RSA_OAEP_Decrypt = function(RSAPrivateKey, EncrypteDataBuffer){ | |
git branch
git clone repo_location
git pull origin branch_name
git push origin branch_name
git commit -S[GPG key]
git merge brach_to_merge --no-commit --no-ff
git status
git stash
git stash apply
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
modprobe.blacklist=nouveau i915.enable_rc6=0 i915.enable_psr=0 i915.preliminary_hw_support=1 i915.enable_hd_vgaarb=1 intel_idle.max_cstate=1 nvidia-drm.modeset=1 |
NewerOlder