Skip to content

Instantly share code, notes, and snippets.

View tobaco's full-sized avatar

Torsten Baldes tobaco

View GitHub Profile
@mrkdevelopment
mrkdevelopment / style.css
Last active January 18, 2024 00:38
Fix Events Calendar for Kadence Theme - width too wide issue
@media screen and (min-width: 1280px) {
.tribe-events.alignwide {
max-width: var(--global-content-width) !important;
margin-left: calc( 50% - ( var(--global-content-width) / 2 )) !important;
margin-right: calc( 50% - ( var(--global-content-width)/ 2 )) !important;
padding: 0 var(--global-content-edge-padding) !important;
}
}
@media screen and (max-width: 1279px) {
.tribe-events-view.alignwide {
@Lineflyer
Lineflyer / tibber_API_pulse_verify.md
Last active August 22, 2023 13:43
Nutzung des Tibber API Explorer um korrekte Datenübertragung des Pulse-Gerätes zu prüfen

Prüfung Pulse-Funktionalität mittels Tibber API-Explorer

Einleitung

Diese kurze Anleitung beschreibt, wie man ohne Nutzung der Tibber-App prüfen kann, ob und welche Daten des Stromzählers der Tibber Pulse (Auslesegerät für den digitale Stromzähler) an die Tibber-Server übermittelt.

Dies kann aus mehreren Gründen vorteilhaft sein:

  • Die Tibber-App hat zeitweise Probleme in der Darstellung der Echtzeitdaten. Somit lässt in solchen Fällen nicht erkennen, ob das Problem in der App oder am heimischen Zähler bzw. Pulse liegt.
  • Während einer eventuell erforderlichen Feinjustierung des Pulse sieht man über die Echtzeitdaten im API schneller die Wirkung der Justierung.
  • Da über das API alle von Tibber unterstützten Werte abgerufen werden, kann man sehen ob und welche Daten vom jeweiligen Zähler unterstützt werden (z.b. Strom/Spannung pro Phase nicht bei jedem Zähler).
@bohwaz
bohwaz / php-8.1-strftime.php
Last active May 14, 2024 13:55
strftime() replacement function for PHP 8.1
<?php
namespace PHP81_BC;
/**
* Locale-formatted strftime using \IntlDateFormatter (PHP 8.1 compatible)
* This provides a cross-platform alternative to strftime() for when it will be removed from PHP.
* Note that output can be slightly different between libc sprintf and this function as it is using ICU.
*
* Usage:
* use function \PHP81_BC\strftime;
@marco79cgn
marco79cgn / vaccination-stats.js
Last active January 11, 2023 21:47
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;
@Greg-Boggs
Greg-Boggs / purge_cf.php
Last active August 7, 2023 09:23
PHP code to Purge Cloudflare Cache
<?php
// Replace EMAIL/API_KEY/ZONE_ID with your details.
// Zone ID is on the dashboard for the domain in the bottom right.
// Api keys are generated from the account settings. You must give cache purge permissions
// Place this script on your webserver and point a Github Webhook at it, and you'll clear
// the Cloudflare cache every time you do a push to GH.
$zoneId = "xxx";
$apiKey = "xxx";
$email = "xxx";
@noelboss
noelboss / RangeDownloadBoss.module.php
Last active June 21, 2018 15:15
Range Download – Usage: wire('modules')->get('ProcessPageView')->sendFile($page, $filename);
<?php
/**
* © noelboss.com
*
* This source file is subject to the license file that is bundled
* with this source code in the file LICENSE.
*
* File created/changed: 2018-06-21T16:24:02+02:00
*/
@FottyM
FottyM / _usage.md
Created January 3, 2018 04:59 — forked from tbranyen/_usage.md
OpenWeatherMap / Weather Icons integration
  1. Include Weather Icons in your app: https://github.com/erikflowers/weather-icons

  2. Include the below JSON in your application, for example purposes, lets assume it's a global named weatherIcons.

  3. Make a request to OpenWeatherMap:

req = $.getJSON('http://api.openweathermap.org/data/2.5/weather?q=London,uk&callback=?');
/*
# WHAT IS THIS?
Use this method on Flickr's camera roll page.
https://www.flickr.com/cameraroll
Then, scroll the page gradually, which allows
Flickr to lazy load the images and links.
@addyosmani
addyosmani / workbox.md
Last active January 20, 2024 16:14
Workbox recipes

Workbox runtime caching recipes

Your Service Worker script will need to import in Workbox and initialize it before calling any of the routes documented in this write-up, similar to the below:

importScripts('workbox-sw.prod.v1.3.0.js');
const workbox = new WorkboxSW();

// Placeholder array populated automatically by workboxBuild.injectManifest()
@adamgiese
adamgiese / nth-child-quantity-mixins.scss
Last active April 19, 2023 11:22
Advanced nth-child mixins
@mixin valid-quantity($quantity) {
@if type-of($quantity) != 'number' {
@error 'The "quantity" parameter must be a number!';
}
@if not(unitless($quantity)) {
@error 'The "quantity" parameter must not have a unit!';
}
@if $quantity < 0 {
@error 'The "quantity" parameter must be at least 0!';
}