Skip to content

Instantly share code, notes, and snippets.

@orthlus
orthlus / habr-pdf.js
Last active August 22, 2024 08:00
habr print button (clean for pdf)
function appendPrintButton() {
const button = document.createElement("button");
button.innerText = "GET PDF";
button.id = "pdf-button";
button.style.margin = '0 20px'
document.querySelector('.tm-main-menu__section').appendChild(button);
function deleteEl(el) {
if (el !== null) {
el.remove()
@orthlus
orthlus / keepawake.ps1
Created June 21, 2023 12:58
just powershell for not logout windows session
$wsh = New-Object -ComObject WScript.Shell; while (1) {$wsh.SendKeys('+{F15}'); Start-Sleep -seconds 180; }
@orthlus
orthlus / git.sh
Last active July 3, 2024 20:17
git utilities
# shrink git folder
git repack -a -d -f --depth=250 --window=250
# update last git commit with current time (for example, to squash with new time)
git commit --amend --reset-author --no-edit
@orthlus
orthlus / self_cert.sh
Last active April 12, 2023 21:53
self cert
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365 -nodes
@orthlus
orthlus / powershell.md
Last active May 7, 2024 17:50
powershell exit with ctrl+D

Set-PSReadlineKeyHandler -Key ctrl+d -Function ViExit

run $Profile, create this path (dir and file), add in file some startup scripts https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7.4

if access denied (during start powershell), this help - https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.4

me helped run as admin this command Set-ExecutionPolicy -ExecutionPolicy Bypass


@orthlus
orthlus / idea-github-markdown-light.css
Last active April 3, 2023 14:34
idea github markdown light css
/*
by
https://gist.github.com/ivalkeen/c093e3401790a02f02e020a2884229e8
https://github.com/sindresorhus/github-markdown-css/blob/main/github-markdown-light.css
go to Settings > Languages & Frameworks > Markdown
checkbox 'add CSS rules' and paste this:
*/
@font-face {
font-family: octicons-anchor;
@orthlus
orthlus / gist:9032021677989aa950554b98be8124c2
Last active April 3, 2023 14:40
telegram desktop sounds
https://github.com/telegramdesktop/tdesktop/tree/dev/Telegram/Resources/sounds
msg_incoming.mp3
helps to replace message sound on mobile device