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
npm audit | grep -E "(High | Critical)" -B3 -A10 |
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
/** | |
* | |
* @param varadocCurry | |
* | |
* @usage | |
* const toSum = varadocCurry((x, y) => x + y, 0); | |
* const toMul = varadocCurry((x, y) => x * y, 1); | |
* | |
* toSum(1)(1, 2)(3, 4)(5, 6, 7)(); // 29 | |
* toMul(1)(1, 2)(3, 4); // 24 |
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
/** | |
* @param curry | |
* | |
* @usage | |
* const _sum3 = (x, y, z) => x + y + z; | |
* const _sum4 = (p, q, r, s) => p + q + r + s; | |
* | |
* const sum3 = curry(_sum3); | |
* sum3(1)(3)(2); // 6 | |
* const sum4 = curry(_sum4); |
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
export const deepFreeze = (object: object) => { | |
const propNames = Object.getOwnPropertyNames(object); | |
for (const num of propNames) { | |
const value = object[num]; | |
object[num] = value && typeof value === 'object' ? deepFreeze(value) : value; | |
} | |
return Object.freeze(object); | |
}; |
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
export const deepFreeze = (object: object) => { | |
const propNames = Object.getOwnPropertyNames(object); | |
for (const num of propNames) { | |
const value = object[num]; | |
object[num] = value && typeof value === 'object' ? deepFreeze(value) : value; | |
} | |
return Object.freeze(object); | |
}; |
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
javascript: (function() { var elements = document.body.getElementsByTagName('*'); var items = []; for (var i = 0; i < elements.length; i++) { if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) { items.push(elements[i]); } } if (items.length > 0) { for (var i = 0; i < items.length; i++) { items[i].innerHTML = ''; } } else { document.body.innerHTML += '<style>* { border: 1px solid red;}</style>'; } })(); |
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
javascript: (function() { var elements = document.body.getElementsByTagName('*'); var items = []; for (var i = 0; i < elements.length; i++) { if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) { items.push(elements[i]); } } if (items.length > 0) { for (var i = 0; i < items.length; i++) { items[i].innerHTML = ''; } } else { document.body.innerHTML += '<style>* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }\ * * { background-color: rgba(0,255,0,.2) !important; }\ * * * { background-color: rgba(0,0,255,.2) !important; }\ * * * * { background-color: rgba(255,0,255,.2) !important; }\ * * * * * { background-color: rgba(0,255,255,.2) !important; }\ * * * * * * { background-color: rgba(255,255,0,.2) !important; }\ * * * * * * * { background-color: rgba(255,0,0,.2) !important; }\ * * * * * * * * { background-c |
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{ | |
stage('SCM Checkout'){ | |
git 'https://github.com/javahometech/my-app' | |
} | |
stage('Compile-Package'){ | |
// Get maven home path | |
def mvnHome = tool name: 'maven-3', type: 'maven' | |
sh "${mvnHome}/bin/mvn package" | |
} | |
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
# include this into the file: .git\hooks\pre-commit | |
# pre-commit to avoid debugger | |
red='\033[0;31m' | |
green='\033[0;32m' | |
yellow='\033[0;33m' | |
no_color='\033[0m' | |
if git commit -v --dry-run | grep 'debugger' >/dev/null 2>&1 | |
then |
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
function isPalindrome(str) { | |
str = str.replace(/\W/g, '').toLowerCase(); | |
return (str == str.split('').reverse().join('')); | |
} | |
console.log(isPalindrome("level")); // logs 'true' | |
console.log(isPalindrome("levels")); // logs 'false' | |
console.log(isPalindrome("A car, a man, a maraca")); // logs 'true' |