Skip to content

Instantly share code, notes, and snippets.

@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 / bookmarklet.rst
Last active June 23, 2021 08:27
Apply all Ozon coupons
@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 / 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 / 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 / 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 / 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; })()
import sublime, sublime_plugin
""" Format text as table
"""
class AlignerCommand(sublime_plugin.TextCommand):
""" Split text by delimeter and format as table with limited width
@param 'limit': int - Max width of table, default is 80
@param 'splitter': str - Custom delimeter, default is ', '
@param 'after': bool - Delimeter position, default is False (before)
@param 'expand': int - Additional space between text and delimeter, default 1