Skip to content

Instantly share code, notes, and snippets.

@dmlogv
dmlogv / YT Speed ask.min.js
Last active April 10, 2024 13:53
Change a YouTube video speed
javascript:(function(){ var v = document.getElementsByTagName("video")[0]; var newRate = prompt("New Speed", v.playbackRate); if(newRate) v.playbackRate = newRate; })()
@dmlogv
dmlogv / file_ext_stat.ps1
Created December 2, 2020 13:56
Space consumption by file types
<#
Summarize file sizes in the current directory
Name Count Size, Mb
---- ----- --------
.CR2 18043 422,723
.jpg 125904 284,799
.img 7 238,507
.mp4 1105 86,354
@dmlogv
dmlogv / linkedin_accept_all_invites.js
Last active August 1, 2022 09:10
Become a LinkedIn Hero
/*
- Open https://www.linkedin.com/mynetwork/invitation-manager/
- Open a Developer console
- Paste code below
- Run it :)
*/
document.querySelectorAll('.invitation-card__action-btn')
.forEach(n => n.innerText == 'Accept' && n.click());
@dmlogv
dmlogv / tracking_mark_read.js
Last active November 30, 2020 11:26
pochta.ru mark tracks read
// Open https://www.pochta.ru/tracking
// Paste to Developer console
// Run
for (node of $$('[class ^= "UpdateStatus"]')) {
node.click();
}
@dmlogv
dmlogv / scroll_page.js
Created October 28, 2020 16:28
Scroll a web page to the footer (to load endless comments)
/*
* Paste in the developer's console
*/
var i = 0;
function scroll(){
var scrollingElement = (document.scrollingElement || document.body);
scrollingElement.scrollTop = scrollingElement.scrollHeight;
console.log('Scroll', i++);
}
@dmlogv
dmlogv / bookmarklet.rst
Last active June 23, 2021 08:27
Apply all Ozon coupons
@dmlogv
dmlogv / habr_prep.md
Last active July 31, 2020 13:57
Habr markdown article preprocessor

To prepare an article to habr.com publishing use following rules:

  • Start an artile with H1 header:

    # Самые талантливые программисты на `sed` в 2020 году #
    
    ...
  • Follow the article header with special quotes for the Tags, Hubs and optional Tutorial mark:

@dmlogv
dmlogv / collect_habr_toc.js
Created July 27, 2020 15:39
Collect Habr (or any other Markdown) table of contest
$$('h2,h3').forEach(el => {
if (el.hasAttribute('id')) {
console.log(`- [${el.innerText}](#${el.id})`);
}
})
@dmlogv
dmlogv / download-vimeo-video.js
Created June 28, 2020 11:11
Download private embed Vimeo video
// Ctrl+Shift+C to open Chrome Console.
// Choose an IFrame of the Vimeo Video with a comment `player.vimeo.com`
// in the drop-down list `top`.
// Run a script:
var videos = [];
$$('script')[3].textContent.match(/\{[^{]+?mp4[^}]+?\}/g).forEach(
x => { o = JSON.parse(x);
videos.push(o);});
videos.sort((a, b) => a.quality.localeCompare(b.quality)).forEach(
@dmlogv
dmlogv / list_users.sh
Created June 18, 2020 11:32
List ClickHouse users.xml users
echo "du /yandex/users" | xmllint --shell /etc/clickhouse-server/users.xml | grep -e '^ \w' | tr -d ' ' | sort