Skip to content

Instantly share code, notes, and snippets.

View Pakirava-Datsuma's full-sized avatar

Dmytro Kulieshov Pakirava-Datsuma

  • Ukraine
View GitHub Profile
@Pakirava-Datsuma
Pakirava-Datsuma / gist:e1bedebc3dbfa5c04442089e5fff74ee
Last active March 7, 2025 16:20
beep browser when a new DOM element appears
[
["li pre.log-line", "Error", 440],
["li pre.log-line", "Warning", 523]
].forEach(([selector, targetText, frequency]) => {
new MutationObserver(mutations =>
mutations.forEach(({ addedNodes }) =>
addedNodes.forEach(node => {
if (node.nodeType === 1 &&
(node.matches?.(selector) || node.querySelector?.(selector)) &&
node.textContent.includes(targetText)) {
@Pakirava-Datsuma
Pakirava-Datsuma / browser snippets.js
Last active July 23, 2025 00:05
JS snippets for browser console
// concat youtube transcript
copy(Array.from(document.querySelectorAll("ytd-transcript-segment-renderer div yt-formatted-string")).reduce((acc, el) => acc + ` ` + el.textContent, ' '))
// print unique commit authors
Array.from(new Set(
Array.from(document.querySelectorAll("a.commit-author"))
.map(a => '@'+a.textContent)
))
.reduce((acc, el) => acc + el + ' ', '')