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
// IPv4 | |
var regexStringIPv4 = '^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'; | |
var regexIPv4 = new RegExp(regexStringIPv4, flags); | |
console.log(regexIPv4.test("192.168.0.25.25.23")); // false | |
console.log(regexIPv4.test("192.168.0.25")); // true |
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
{ | |
"validPort" : ["256"], | |
"invalidPort" : [], | |
"minPort" : "1000", | |
"maxPort" : "1200" | |
} |
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
// Reference - https://www.w3resource.com/javascript-exercises/javascript-date-exercise-8.php | |
var date_diff_inseconds = function (date1, date2) { | |
let dt1 = new Date(date1); | |
let dt2 = new Date(date2); | |
return Math.floor((Date.UTC(dt2.getFullYear(), dt2.getMonth(), dt2.getDate(), dt2.getHours(), dt2.getMinutes(), dt2.getSeconds()) - Date.UTC(dt1.getFullYear(), dt1.getMonth(), dt1.getDate(), dt1.getHours(), dt1.getMinutes(), dt1.getSeconds())) / (1000)); | |
}; | |
var date_diff_inminutes = function (date1, date2) { | |
let dt1 = new Date(date1); | |
let dt2 = new Date(date2); |
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 |
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){ | |
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 | |
}; |
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
'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
// 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() | |
} |