Skip to content

Instantly share code, notes, and snippets.

@marco79cgn
marco79cgn / vaccination-stats.js
Last active September 28, 2026 22:15
A Scriptable widget that shows the amount of people who have received the corona vaccination in Germany
// Version 1.3.0
// 27.11.2021
//
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: red; icon-glyph: notes-medical;
// Mit Caching und Fallback
const cacheMinutes = 60; // 60 min
const today = new Date();
const neededTotalVaccinations = 83200000;
@marco79cgn
marco79cgn / dm-toilet-paper-wheat-flour.js
Last active September 3, 2026 18:47
iOS Widget, das die Anzahl an Klopapier und Mehl Packungen in deiner nächsten dm Drogerie anzeigt (für die scriptable.app)
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: gray; icon-glyph: magic;
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: green; icon-glyph: magic;
// dm Klopapier & Mehl Widget
//
// Copyright (C) 2020 by marco79 <marco79cgn@gmail.com>
//
@marco79cgn
marco79cgn / dm-toilet-paper.js
Last active September 3, 2026 18:46
iOS Widget, das die Anzahl an Klopapier Packungen in deiner nächsten dm Drogerie anzeigt (für die scriptable.app)
// dm Klopapier Widget
//
// Copyright (C) 2020 by marco79 <marco79cgn@gmail.com>
//
// Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
// IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
@marco79cgn
marco79cgn / spotify-now-playing.js
Last active July 28, 2026 07:35
A Scriptable iOS widget that shows what‘s playing on Spotify
let spotifyCredentials
let widget = await createWidget()
Script.setWidget(widget)
Script.complete()
async function createWidget() {
let widget = new ListWidget()
let spotifyIcon = await getImage("spotify-icon.png")
widget.backgroundColor = new Color("1e2040")
@marco79cgn
marco79cgn / iphoneblog-update-notifier.sh
Created June 5, 2026 10:10
Checks RSS feed for new content and sends push notification via ntfy.sh
#!/usr/bin/env bash
set -euo pipefail
# the rss feed url to check
FEED_URL="https://www.iphoneblog.de/feed/"
# temporary state file to compare
STATE_FILE="/tmp/rss-top-item.id"
mkdir -p "$(dirname "$STATE_FILE")"
#!/bin/bash
myAddrApiKey="b3******f4"
myAddrUrl="marco79.myaddr.io"
ntfyUrl="https://ntfy.sh/****"
if ! currentDynDns=$(dig +time=5 +tries=6 +short $myAddrUrl @86.54.11.100); then
echo "Problem: dig network error or timeout."
exit 1
fi
echo "myaddr ip: $currentDynDns"
@marco79cgn
marco79cgn / ard-plus-dl.sh
Last active January 17, 2026 17:22
Ein Skript zum downloaden von Videos bei ARD Plus (→ https://github.com/marco79cgn/ard-plus-dl)
Umgezogen, jetzt hier zu finden:
https://github.com/marco79cgn/ard-plus-dl
@marco79cgn
marco79cgn / update-myaddr-dns.sh
Last active November 23, 2025 11:56
Shell script which checks whether the public ip address has changed and updates myaddr.tools DynDNS
#!/bin/bash
# insert your myaddr data and ntfy push topic
myAddrApiKey="***"
myAddrUrl="replace-me.myaddr.io"
ntfyUrl="https://ntfy.sh/***"
publicDnsResolver="86.54.11.100" # use DNS4EU
# function to validate IPv4 address (format + range)
is_ipv4() {
local ip="$1"
@marco79cgn
marco79cgn / check-ipv4-syntax.sh
Created November 23, 2025 11:44
Check if return value is a valid ipv4 address
#!/bin/bash
myAddrUrl="REPLACE.myaddr.io"
# max 6 tries every 5 seconds (if connection is currently offline)
if ! currentDynDns=$(dig +time=5 +tries=6 +short $myAddrUrl @86.54.11.100); then
echo "Problem: dig network error or timeout."
exit 1
fi
# check if ip syntax is correct
@marco79cgn
marco79cgn / bbc2-playlist.js
Last active November 11, 2025 06:14
A custom iOS widget that shows the last 5 songs from BBC2 radio and plays them in Spotify (for Scriptable.app)
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: red; icon-glyph: music;
// insert your Spotify client id and secret here
const clientId = "xxx"
const clientSecret = "xxx"
let widget = new ListWidget()
widget.setPadding(22,10,10,10)