Skip to content

Instantly share code, notes, and snippets.

View DimaRGB's full-sized avatar

Dmytro Lyfarenko DimaRGB

View GitHub Profile
@DimaRGB
DimaRGB / calculateExpenses.js
Last active January 24, 2019 01:06
privat24: calculate expenses by regexp
// tab charts -> scroll down -> inspect table (iframe)
// taxi example
(function calculateExpenses(regexp) {
regexp = new RegExp(regexp, 'i');
const allDescs = document.querySelectorAll('.t_descr'); console.log(allDescs);
const descs = Array.prototype.filter.call(allDescs, desk => regexp.test(desk.innerText)); console.log(descs);
const monies = descs.map(desk => +desk.nextSibling.childNodes[0].childNodes[0].innerText.slice(1)); console.log(monies);
const sum = monies.reduce((sum, money) => sum + money, 0);
return `${sum.toFixed(2)} грн`;
@DimaRGB
DimaRGB / github-unwatch.js
Last active November 15, 2018 12:55
unwatch github organization repos
// example: unwatchOrgRepos('wkda')
// run this function on all pages https://github.com/watching
function unwatchOrgRepos(orgName) {
let orgRepoTitleNodes = document.querySelectorAll(`[title=${orgName}]`);
Array.prototype.map.call(orgRepoTitleNodes, span => {
span.parentElement.parentElement.parentElement.querySelector('.js-unsubscribe-form>[type=submit]').click()
});
}
1. `git merge [base-branch]`
2. `rm package-lock.json` ( if you see conficts in this file )
3. `npm i`
4. `npm ddp`

Keybase proof

I hereby claim:

  • I am dimargb on github.
  • I am dima_rgb (https://keybase.io/dima_rgb) on keybase.
  • I have a public key ASDdsSRVDr-Jbe0_ufZkr29_BROT9574fkD4B8az0Kb-awo

To claim this, I am signing this object:

atom