Skip to content

Instantly share code, notes, and snippets.

Avatar

Tobias Battenberg mountbatt

View GitHub Profile
@mountbatt
mountbatt / wetter.js
Last active Mar 10, 2021
Scriptable Widget to get Weather Data from a weewx driven Weather-Station via JSON by weewx-json (https://github.com/teeks99/weewx-json). With Shortcodes this Widget is fully Siri compatible!
View wetter.js
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: blue; icon-glyph: sun;
// Check weewx Weather
// Script Updates: https://gist.github.com/mountbatt/163c5d8f8bd7978e1f3c06b3dcccf00f
// Version: 0.7.4
// edit:
let endpoint = "http://www.waldbadviertel-wetter.de/current_minimal.json"
let prefix = "im" // im | in | at ... defines "im Waldbadviertel" oder "in Cologne" (set to "in" or "at" for good english)
@mountbatt
mountbatt / inline-portrait.svg.php
Created Feb 10, 2021
Use a SVG-shape for images in WordPress
View inline-portrait.svg.php
<!-- this is our svg in /images/inline-portrait.svg.php. Make sure the filename ends with *.svg.php -->
<!-- in the "pattern" we create a unique identifier with a sanitized url of the image -->
<!-- this "id" is used as "fill" -->
<svg aria-label="<?php the_title(); ?>" role="img" viewBox="0 0 256 257" version="1.1" class="">
<title><?php the_title(); ?></title>
<defs>
<pattern id="imageID-<?php echo trim(preg_replace('/[^a-z0-9]+/i',"", strtolower(htmlspecialchars_decode($url)))); ?>" width="100%" height="100%" patternUnits="userSpaceOnUse">
<image height="100%" width="100%" x="0" xlink:href="<?php echo $url;?>" y="0"></image>
</pattern>
@mountbatt
mountbatt / ZOE-Widget.js
Last active Jun 14, 2021
Scriptable iOS widget that displays the status of your Renault ZOE on your iPhone and iPad.
View ZOE-Widget.js
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: light-gray; icon-glyph: car;
// version 2021-02-10
// add your my-renault account data:
let myRenaultUser = "user" // email
let myRenaultPass = "pass" // password
// set your ZOE Model (Phase 1 or 2) // bitte eingeben!