Skip to content

Instantly share code, notes, and snippets.

View rugk's full-sized avatar
🤔
Thinking…

rugk rugk

🤔
Thinking…
View GitHub Profile
@rugk
rugk / bizay-extract-products.js
Last active November 27, 2025 22:27
Extract all products and their links (as simple HTML); to be pasted into the browser console. You can then paste and open a simple HTML file for copying it to a WYSIWYG editor e.g. – https://www.bizay.de
const productLinks = [];
const seenTitles = new Set();
Array.from(document.querySelectorAll(".product-title")).forEach(x => {
const title = x.textContent.trim(); // Get the product name
const link = x.closest('a').href; // Get the closest <a> link
// Check if the product name has already been processed
if (!seenTitles.has(title)) {
seenTitles.add(title); // Mark this product name as seen
@rugk
rugk / ai-jsdoc.md
Created August 19, 2025 20:17
AI chat on how to do enums with proper type-enforcement through JSDoc in VSCode (Copilot - GPT 4.1)

rugk: > Argument of type 'string' is not assignable to parameter of type '{ [x: string]: string; }'.ts(2345)

for rowserCommunication.addListener

Now the issue is wrong JSDOC actually. See #file:BrowserCommunication.js * @param {COMMUNICATION_MESSAGE_TYPE} messageType type of message is wrong JSDOC. If you see #file:BrowserCommunicationTypes.js you see it is an object of strings, but i should just be used more or less like an enum (which JS itself does not have), so you provide a specific value, but cannot provide any arbotrary string.

How can I fix the JSDoc to represent that?

Jun 10 15:43:00 **** systemd[1]: Started systemd-coredump@3-106724-0.service - Process Core Dump (PID 106724/UID 0).
Jun 10 15:43:03 **** systemd-coredump[106725]: [🡕] Process 106264 (firefox) of user 1000 dumped core.
Module libpcsclite.so.1 from rpm pcsc-lite-2.0.3-1.fc40.x86_64
Module legacy.so from rpm openssl-3.2.1-2.fc40.x86_64
Module libopensc.so.11 from rpm opensc-0.25.0-1.fc40.x86_64
Module opensc-pkcs11.so from rpm opensc-0.25.0-1.fc40.x86_64
Module libtasn1.so.6 from rpm libtasn1-4.19.0-6.fc40.x86_64
Module p11-kit-trust.so from rpm p11-kit-0.25.3-4.fc40.x86_64
Module libmpg123.so.0 from rpm mpg123-1.31.3
@rugk
rugk / coupons-filtered.json
Created January 12, 2024 18:50
sovendus-network.com coupons
[
{
"couponId": 16280,
"value": "12 %",
"shopName": "Shop Apotheke",
"label": "Neukundengutschein für alle Marken",
"type": "online",
"keywords": [
"Apotheke",
"Arzneimittel",
@rugk
rugk / workaround-podman-issue19913.sh
Last active October 27, 2024 16:40
Workaround script for podman rm (--force) does not work anymore ("container state improper"/"invalid argument" when unmounting) and start neither, see https://github.com/containers/podman/issues/19913
#!/bin/bash
#set -x
# Define the list of containers you want to remove
containers=("nextcloud_redis_1" "nextcloud_db_1" "nextcloud_nc_1")
for container in "${containers[@]}"; do
echo "Now handling $container..."
# First attempt to forcefully remove the container
podman rm --force "$container"
@rugk
rugk / Notrufnummern.vcf
Last active February 14, 2023 08:27
Deutsche Notrufnummern als VCARD zum Importieren in die Kontakte
BEGIN:VCARD
VERSION:3.0
PRODID:-//Sabre//Sabre VObject 4.4.1//EN
UID:020b3274-6fb5-4997-887a-2a22cb93c4f2
REV;VALUE=DATE-AND-OR-TIME:20200318T210544Z
FN:Polizei (Deutschland)
ADR;TYPE=HOME:;;;;;;
EMAIL;TYPE=HOME:
TEL;TYPE=VOICE:110
CATEGORIES:Notrufnummern
@rugk
rugk / attackRedirect.html
Created February 10, 2020 16:18
iFrame messaging vulnerabilities in Riot.im, see https://github.com/vector-im/riot-web/issues/6173
<html>
<head>
<script>
// get when tab is switched
(function() {
var hidden = "hidden";
// Standards:
if (hidden in document)
document.addEventListener("visibilitychange", onchange);
@rugk
rugk / emojicoun.md
Created June 3, 2019 19:42
only missing
Country Users % of Total
Germany 1700 31.1%
United States 613 11.2%
France 427 7.8%
United Kingdom 303 5.5%
Italy 227 4.2%
Australia 134 2.5%
Poland 129 2.4%
@rugk
rugk / playground.ftl
Last active January 19, 2019 22:20
OSM "level" translation in fluent with alternative versions when travelling in foreign countries
### input data: ground floor = level 0
### for OSM "level" tag, see https://wiki.openstreetmap.org/wiki/Key:level
### KNOWN BUGS:
### 1. I cannot remove the minus (-) sign from negative levels. See https://github.com/projectfluent/fluent/issues/228
### 2. I cannot properly calculate +1 for the US style. See https://github.com/projectfluent/fluent/issues/227
## SYNTAX: floor_<userlanguage>_<country-travelling-to>
## i.e. e.g. floor_DE_EUROP = German-speaking user travelling to Germany (or any other country with basement=level 0)
@rugk
rugk / playground.ftl
Created January 19, 2019 19:38
OSM "level" translation in fluent
### input data: ground floor = level 0
### for OSM "level" tag, see https://wiki.openstreetmap.org/wiki/Key:level
### KNOWN BUGS:
### 1. I cannot remove the minus (-) sign from negative levels. See https://github.com/projectfluent/fluent/issues/228
### 2. I cannot properly calculate +1 for the US style. See https://github.com/projectfluent/fluent/issues/227
## Style, where floor = level 0 = input data