Skip to content

Instantly share code, notes, and snippets.

@sk22
sk22 / jellyfin-custom.css
Last active May 26, 2021
custom css for jellyfin. no more accidental full volume on touch
View jellyfin-custom.css
.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
make firefox web app profiles based on profile "webapp.template" with installed firefox-gnome-theme (https://github.com/rafaelmardojai/firefox-gnome-theme)
View make-web-app
#!/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
run this script on twitter web, click the "more" button and watch the tweet disappear
View twitter-quick-delete-bookmarklet.js
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 / imgs2pdf.bat
Last active Apr 14, 2021
wrapper script for img2pdf to facilitate creating a pdf by simply dragging and dropping the file list
View imgs2pdf.bat
@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 Feb 25, 2021
bookmarklet that writes twitter alt texts to the tooltip and blurs images that don't have an alt text
View _0_visualize-twitter-alt-texts-bookmarklet.md

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:

View touchegg.conf.xml
<!--
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 / pwsh.ps1
Created Nov 6, 2020
learning powershell. syntax weird much hence cheat sheet
View pwsh.ps1
'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' }
View node-tweets.sh
#!/bin/sh
# run inside twitter-archive/data - there should be a tweet.js file
# this tweet.js file is meant to be read by the browser and can be
# a pain to import into a node.js repl. this script adds the necessary
# lines that let your import the tweets using a simple node require()
echo "const window = { YTD: { tweet: {} } }" > tweets.module.js
cat tweet.js >> tweets.module.js
@sk22
sk22 / wienwahl-2020-positionen-0.csv
Last active Oct 6, 2020
übersichtliche auflistung der positionen zu den wahlkabine-fragen. die daten sind von hier: https://wahlkabine.at/api/articles/landtagswahl-wien-2020
View wienwahl-2020-positionen-0.csv
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 9.
"Frage","LINKS","SPÖ","GRÜNE","BIER"
"Soll die Stadt Wien Aufträge nur an Firmen vergeben, die maximal 10% Leiharbeit einsetzen?","✅✅","✅✅","✅","✅✅✅"
"Soll statt der Mindestsicherung die geringere “Sozialhilfe Neu” auch in Wien umgesetzt werden?","❌❌❌","❌❌❌","❌❌❌","❌"
"Soll in ausgewählten Tourismuszonen eine Ladenöffnung am Sonntag ermöglicht werden?","❌❌❌","❌❌❌","❌❌","❌"
"Sollen an öffentlichen Orten (zum Beispiel Donaukanal und Prater) mehr kommerzielle Gastrobetriebe bewilligt werden?","❌❌","❌","❌❌","❌❌❌"
"Sollen Schwangerschaftsabbrüche im Wiener Gesundheitsverbund kostenfrei sein?","✅✅✅","✅✅","✅✅✅","✅✅✅"
"Sollen Spitalsbetten an PatientInnen über einen Algorithmus vergeben werden, um eine gerechtere Verteilung knapper Ressourcen zu gewährleisten?","❌❌","❌❌❌","❌","✅✅"
"Soll die Stadt Wien eine Leerstandsabgabe von 25% des Mietzinsrichtwerts für Wohnungen einführen?","✅✅✅","❌","✅✅","✅✅"
"Soll im sozialen Wohnbau die Bevorzugung von Menschen, die schon länger in Wien gemeldet sind, abgeschafft werden?","✅✅
@sk22
sk22 / Im-Brennpunkt-Der-ganz-normale-Rassismus-rev4.srt
Last active Sep 27, 2020
Subtitles: “Im Brennpunkt: Der ganz normale Rassismus” (ORF, 2020)
View Im-Brennpunkt-Der-ganz-normale-Rassismus-rev4.srt
1
00:00:00,000 --> 00:00:01,020
*
2
00:00:05,020 --> 00:00:08,060
UT: Samuel Kaiser (2020, Revision 4)
3
00:00:15,760 --> 00:00:18,100