Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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' }
#!/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 October 6, 2020 14:15
übersichtliche auflistung der positionen zu den wahlkabine-fragen. die daten sind von hier: https://wahlkabine.at/api/articles/landtagswahl-wien-2020
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 September 27, 2020 14:53
Subtitles: “Im Brennpunkt: Der ganz normale Rassismus” (ORF, 2020)
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
@sk22
sk22 / libinput-gestures.conf
Last active September 15, 2020 16:42
libinput-gestures with windows-like gestures
# https://github.com/bulletmark/libinput-gestures/blob/master/libinput-gestures.conf
gesture swipe up 4 _internal ws_up
gesture swipe down 4 _internal ws_down
gesture swipe down 3 xdotool key super+d
gesture swipe up 3 xdotool key super+s
gesture swipe left 3 xdotool key alt+Right
gesture swipe right 3 xdotool key alt+Left
gesture swipe left 4 xdotool key alt+Tab
gesture swipe right 4 xdotool key alt+Tab
@sk22
sk22 / .searchrc
Last active August 25, 2020 17:38
search using a regex pattern and link the resulting files into a directory
#!/bin/sh
export SEARCH_PATH=${SEARCH_PATH:-../source}
export USE_PATTERN_AS_RESULTS=${USE_PATTERN_AS_RESULTS:-true}
export DELETE_FOLDER=${DELETE_FOLDER:-true}
prename -n 's/\d{5}IMG_\d{5}_BURST(\d{8})(\d{6})\d{3}_COVER/IMG_$1_$2/' **/*
# 00000IMG_00000_BURST20190829132824951_COVER.jpg -> IMG_20190829_132824.jpg
# remove -n to apply changes
# requires perl rename