Skip to content

Instantly share code, notes, and snippets.

View bjesus's full-sized avatar

Yo'av Moshe bjesus

View GitHub Profile
@bjesus
bjesus / emojis
Last active August 7, 2024 13:34
emojis picker for wayland
😀 Grinning Face
😃 Grinning Face with Big Eyes
😄 Grinning Face with Smiling Eyes
😁 Beaming Face with Smiling Eyes
😆 Grinning Squinting Face
😅 Grinning Face with Sweat
🤣 Rolling on the Floor Laughing
😂 Face with Tears of Joy
🙂 Slightly Smiling Face
🙃 Upside-Down Face
@bjesus
bjesus / gvb.sh
Created October 25, 2023 09:15
GVB station departures
#!/bin/sh
echo '[5,"/stops/09900"]' | websocat wss://maps-wss.gvb.nl/ -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0' | tail -n +2 | while read -r line; do printf '%s\n' "$line" | jq -r '.[2]' | jq -r '.trip.lastCallMade.plannedDepartureAt + " " + .journey.publicLineNumber + " " + .journey.destination + " (" + .trip.lastCallMade.status + ", " + (.trip.lastCallMade.delay|tostring) + " delay)"'; done
@bjesus
bjesus / iwdqr
Created February 24, 2023 16:19
Linux wifi iwd qr code generator for sharing ssid and passphrase
#!/bin/bash
FILE=$(sudo find /var/lib/iwd -iname '*.psk' -type f -printf "%T+ %p\n" | sort | tail -1 | cut -d ' ' -f2-)
SSID=${FILE:13:-4}
PASS=$(sudo cat "$FILE" | grep Passphrase | cut -c 12-)
STRING="WIFI:S:$SSID;T:WPA;P:$PASS;;"
qrencode -t UTF8 "$STRING"
echo -e "SSID: \033[1m${SSID}\033[0m"
echo -e "Passphrase: \033[1m${PASS}\033[0m"
@bjesus
bjesus / 0-not-your-lab.md
Last active September 26, 2024 09:38
My browser isn't your lab, do your tests elsewhere - turning off the Performance Web API

RUM testing is inherently flawed

Everyone wants their website to be fast. For many years, we had synthetic tests: you spin up some automated browser, load your site, measure, done. It's not perfect, but it's a pretty good indicator for how fast your website is. You can simulate slow networks. You can run this automated browser on a different continent. It offers some flexibility.

But then someone convinced us all that it isn’t enough. You have to actually measure the peformance in the browsers of your users. RUM came into the world. From MDN:

Real User Monitoring or RUM measures the performance of a page from real users' machines. Generally, a third party script injects a script on each page to measure and report back on page load data for every request made. This technique monitors an application's actual user interactions. In real user monitoring, the browsers of real users report back performanc

@bjesus
bjesus / README.md
Last active February 4, 2025 08:08
Weather widget for waybar
@bjesus
bjesus / config.json
Last active September 16, 2020 15:00
Catt (chromecast) indicator for Waybar
"custom/cast": {
"format": "{icon} {}",
"tooltip": true,
"interval": 3,
"return-type": "json",
"format-icons": {
"default": "🎜"
},
"exec": "/PATH/TO/waybar-catt.py",
"exec-if": "nmcli -t | grep -q NAME_OF_YOUR_HOME_WIFI",
@bjesus
bjesus / config.json
Last active January 29, 2025 14:09
Khal indicator for Waybar
"custom/events": {
"format": "{}",
"tooltip": true,
"interval": 300,
"format-icons": {
"default": ""
},
"exec": "waybar-khal.py",
"return-type": "json"
},
@bjesus
bjesus / apple-music-playlist-to-text.js
Created July 24, 2020 10:35
apple music playlist to text
// Run in the browser console
songlist = ""
for (const song of document.getElementsByClassName('two-lines')) {
title = song.getElementsByClassName('song-name')[0].textContent.trim()
artist = song.getElementsByClassName('by-line')[0].textContent.trim()
a += artist+" - "+title+"\n"
==> Retrieving sources...
-> Found gitin-0.1.5.tar.gz
==> Validating source files with sha256sums...
gitin-0.1.5.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
-> Extracting gitin-0.1.5.tar.gz with bsdtar
==> Sources are ready.
==> Making package: gitin 0.1.5-2 (Sun 03 Mar 2019 16:02:32 CET)
==> Checking runtime dependencies...
@bjesus
bjesus / index.html
Created September 28, 2016 11:21
Hebrew text with Arabic diacritics
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hebrew text with Arabic diacritics</title>
</head>
<body dir="rtl">
<h1>אֶלסָّלָאם אלשָّאמֶל ואלעָאדֶל ואלכָּאמֶל</h1>