Skip to content

Instantly share code, notes, and snippets.

@sk22
sk22 / de-us-cheet-sheet.md
Last active January 12, 2022 19:13
US layout Cheet Sheet for German keyboards

US keyboard layout

Cheat Sheet for German keyboards

ANSI layout

  • US < DE

Alphabet

  • Z < Y
# you can also use bash tricks like
# `wget https://blabla/manifest_blabla_296221{1..9}`
# and use cool editors like visual studio code to edit multiple lines
# at the same time to avoid wasting time
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_video_1_5_init.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_video_1_5_2962209.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_video_1_5_2962210.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_video_1_5_2962211.mp4
wget https://orf2.mdn.ors.at/out/u/orf2/qxb/manifest_video_1_5_2962212.mp4
@sk22
sk22 / jellyfin-custom.css
Last active May 26, 2021 12:38
custom css for jellyfin. no more accidental full volume on touch
.layout-mobile .volumecontrol .nowPlayingVolumeSliderContainer {
visibility: hidden;
opacity: 0;
transform: scale(0.9);
transition: opacity 0.3s ease;
transition-property: opacity, transform;
position: fixed;
top: 50vh;
left: 0;
width: 60%;
@sk22
sk22 / make-web-app
Last active May 18, 2021 09:52
make firefox web app profiles based on profile "webapp.template" with installed firefox-gnome-theme (https://github.com/rafaelmardojai/firefox-gnome-theme)
#!/bin/bash
PROFILES=$HOME/.mozilla/firefox
TEMPLATE_DIR=$PROFILES/webapp.template
usage() {
cat << EOF
make-web-app
-n name (e.g. twitter, used as profile name and wm class webapp.twitter)
-t title (e.g. Twitter)
@sk22
sk22 / twitter-quick-delete-bookmarklet.js
Created May 4, 2021 11:37
run this script on twitter web, click the "more" button and watch the tweet disappear
document.querySelectorAll('div[aria-label="More"]').forEach(more => more.addEventListener('click', () => {
setTimeout(() => document.querySelectorAll('div[role="menuitem"][tabindex="0"]')[0].click(), 250)
setTimeout(() => document.querySelector('[data-testid="confirmationSheetConfirm"]').click(), 500)
}))
@sk22
sk22 / touchegg.conf.xml
Last active April 30, 2021 14:53
~/.config/touchegg/touchegg.conf (https://github.com/JoseExposito/touchegg)
<!--
TOUCHÉGG CONFIG BY @SK22
* 3 finger swipe gestures are managed by GNOME 40
* 4 finger swipe up/down maximizes/restores the window (using Super+Up/Down)
* 4 finger swipe left/right navigates backward/forward (using Alt+Left/Right)
* 3 finger pinch inwards closes the window (using the Touchégg action)
@sk22
sk22 / imgs2pdf.bat
Last active April 14, 2021 13:10
wrapper script for img2pdf to facilitate creating a pdf by simply dragging and dropping the file list
@echo off
rem make sure to install python3 and "pip install img2pdf" before using this script
echo creating pdf from files:
echo.
echo %*
img2pdf -o %1.pdf %*
echo.
echo saved as %1.pdf
echo.
@sk22
sk22 / _0_visualize-twitter-alt-texts-bookmarklet.md
Last active February 25, 2021 21:49
bookmarklet that writes twitter alt texts to the tooltip and blurs images that don't have an alt text

save this as a bookmark:

make sure the javascript: part stays in place - your browser might remove it for security reasons when pasting!

javascript:(({excludeQueries:a,defaultAltTexts:b,disableBlur:c})=>{window.visualizeAltTextInterval?(clearInterval(window.visualizeAltTextInterval),delete window.visualizeAltTextInterval,document.getElementsByTagName("img").forEach(a=>{a.title="",a.parentNode.style.filter=null})):window.visualizeAltTextInterval=window.setInterval(()=>{const d=a.map(a=>":not("+a+")").join(""),e=([a,d])=>{a.title=d,a.style.zIndex="1",d&&!b.includes(d)||c||(a.parentNode.style.filter="blur(15px)")};Array.from(document.querySelectorAll("img"+d)).map(a=>[a,a.alt]).forEach(e),Array.from(document.querySelectorAll("video"+d)).map(a=>[a,a.getAttribute("aria-label")]).forEach(e)},100)})({excludeQueries:["#partner_id_sync_pixel"],defaultAltTexts:["Image","Bild"],disableBlur:false})

^^^

or copy this code into your browser's address bar:

@sk22
sk22 / pwsh.ps1
Created November 6, 2020 14:24
learning powershell. syntax weird much hence cheat sheet
'hello', 'aaaaa', 'eeeee'
| % { $_ -replace 'e', 'a' }
| % { $_ -replace 'hallo', 'oida' }
| ? { $_ -like '*a*' }
# equivalent to
@('hello', 'aaaaa', 'eeeee')
| ForEach-Object { $PSItem -replace 'e', 'a' }
| ForEach-Object { $PSItem -replace 'hallo', 'oida' }
@sk22
sk22 / how-to-media-button.md
Last active October 29, 2020 09:27
Replace "PC Manager" Fn key with play/pause

Replace "PC Manager" Fn key with custom action

How I replaced the "PC Manager" Fn key on my Huawei Matebook X Pro with a play/pause button.

Background

The Huawei Matebook X Pro, as well as other devices from various manufacturers have a Fn key with a proprietary function. On the Matebook, it's a button that does nothing but open the so-called PC Manager software, and is located on the F10 key. Since at least I really don't need this function and am missing a play/pause Fn key, I decided to try replacing the function.