I hereby claim:
- I am mo7amd on github.
- I am mo7amd (https://keybase.io/mo7amd) on keybase.
- I have a public key ASBnLvGmSe6Ru7zd3wBiYMf3WLDKVdSwEG1hGZyOyj5_Xgo
To claim this, I am signing this object:
export const formateToEllipses = (string = '', maxCharAtOneLine, maxLines) => { | |
const ellipses = '...'; | |
const separator = ' '; | |
const words = string.split(separator); | |
let lineNum = 1; | |
const lines = []; | |
let line = ''; | |
const addEllipses = str => str.substring(0, maxCharAtOneLine - 3) + ellipses; | |
const isLargerThanLine = word => word.length > maxCharAtOneLine; | |
const gotoNewLine = (isEllipses = false, initial = '') => { |
I hereby claim:
To claim this, I am signing this object:
function getIdsList () { | |
document.querySelectorAll('a.UFIPagerLink').forEach(el => el.click()) | |
const idSelector = '.UFICommentAuthorWithPresence.img._8o._8s.UFIImageBlockImage'; | |
const namesSelector = `${idSelector} img`; | |
const el = document.querySelectorAll(idSelector); | |
const names = document.querySelectorAll(namesSelector); | |
const ids = []; | |
el.forEach((auth, index) => { | |
const link = auth.getAttribute('data-hovercard'); | |
const name = names[index].getAttribute('alt'); |
data[?(@.firstName === 'Zee')] // find obj with firstName key = 'zee' | |
data[*]['key1','key2'] // get certain keys of object on all the data |
find . -maxdepth 1 -mindepth 1 -type d -exec bash -c 'cd "$0"; npm i' {} \; |
/* | |
References: | |
============== | |
1: HTTPS://WWW.QUORA.COM/WHAT-IS-THE-RECURSIVE-SOLUTION-FOR-FINDING-ALL-SUBSETS-OF-A-GIVEN-ARRAY | |
2: HTTPS://WWW.IDESERVE.CO.IN/LEARN/GENERATE-ALL-SUBSETS-OF-A-SET-RECURSION | |
hellow world from emacs | |
*/ |
// add method to Map object | |
Map.prototype.add = function (key, value){ | |
// check first if the key has value if not just set the value to the key | |
if ( map.has(key)) { | |
let oldValue = map.get(key); // get old value | |
let tempArr = []; // create temp array to collect new and values together | |
/* check if old value is array or not to make the values on one array which make | |
iteration over it when get the value command excute easier | |
**/ | |
oldValue.constructor === Array ? tempArr = oldValue : tempArr.push(oldValue); |
$(function(){ | |
var selected = 0; | |
$('.rating__stars i').click(function(){ | |
selected = $(this).index(); | |
}); | |
$('.rating__stars i').hover( | |
function(){ | |
var index = $(this).index(); | |
for(var i=0;i<index;i++){ | |
$('.rating__stars i').eq(i).css("color","#ff9800"); |
var offset = $('div.saudi-trader-nav__item__menu').offset(); | |
$('element').css("top",-offset.top); |
$('child').hide(); | |
$('parent').mouseover(function(){ | |
$(this).find('child').show(); | |
anchor_hover(); | |
}).mouseout(function(){ | |
anchor_hover(); | |
$(this).find('child').hide(); | |
}); |