Skip to content

Instantly share code, notes, and snippets.

💻
¯\_(ツ)_/¯

Leo Lanese leolanese

💻
¯\_(ツ)_/¯
Block or report user

Report or block leolanese

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@leolanese
leolanese / Show both Critical and High Issues
Created Oct 28, 2019
Show both Critical and High Issues
View Show both Critical and High Issues
npm audit | grep -E "(High | Critical)" -B3 -A10
View fp-varadocCurry
/**
*
* @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
View fp-curry
/**
* @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);
View deepFreeze
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);
};
View deepFreeze
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);
};
View css-editor-bookmark-2
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>'; } })();
View css-editor-bookmark
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
View sonar-jenkins
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"
}
View !nocommit
# 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
View gist:06acd13f5ac1d78615065044c71a2a7e
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'
You can’t perform that action at this time.