Skip to content

Instantly share code, notes, and snippets.

View pfefferle's full-sized avatar
😴
zzZZzzzZzzZZzZZZ

Matthias Pfefferle pfefferle

😴
zzZZzzzZzzZZzZZZ
View GitHub Profile
@Zodiac1978
Zodiac1978 / disallow-gptbot.php
Created August 10, 2023 14:46
Add line in robots.txt to disallow GPTBot. (WordPress plugin)
<?php
/**
* Plugin Name: Disallow GPTBot
* Description: Add line in robots.txt to disallow GPTBot.
* Plugin URI: https://torstenlandsiedel.de
* Version: 1.0
* Author: Torsten Landsiedel
* Author URI: http://torstenlandsiedel.de
* Licence: GPL 2
* License URI: http://opensource.org/licenses/GPL-2.0
@sgvj
sgvj / Asakuki.yaml
Last active November 6, 2023 06:29
My Asakuki Esphome Configuration file
# This fits my needs, some logic could/should be added so let me know if you figure it out
# I deliberarly de-coupled lights and mist
# Most of my useage comes from automations that trigger actions, I have a single mist on/off switch in HomeAssistant UI
substitutions:
devicename: asakuki
esphome:
name: $devicename
platform: ESP8266
@marco79cgn
marco79cgn / dm-toilet-paper.js
Last active February 29, 2024 17:35
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
@kevinkub
kevinkub / incidence.js
Last active June 27, 2023 12:53
COVID-19 Inzidenz-Widget für iOS innerhalb Deutschlands 🇩🇪
// Licence: Robert Koch-Institut (RKI), dl-de/by-2-0
class IncidenceWidget {
constructor() {
this.previousDaysToShow = 31;
this.apiUrlDistricts = (location) => `https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?where=1%3D1&outFields=RS,GEN,cases7_bl_per_100k,cases7_per_100k,BL&geometry=${location.longitude.toFixed(3)}%2C${location.latitude.toFixed(3)}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&returnGeometry=false&outSR=4326&f=json`
this.apiUrlDistrictsHistory = (districtId) => `https://services7.arcgis.com/mOBPykOjAyBO2ZKk/ArcGIS/rest/services/Covid19_hubv/FeatureServer/0/query?where=IdLandkreis%20%3D%20%27${districtId}%27%20AND%20Meldedatum%20%3E%3D%20TIMESTAMP%20%27${this.getDateString(-this.previousDaysToShow)}%2000%3A00%3A00%27%20AND%20Meldedatum%20%3C%3D%20TIMESTAMP%20%27${this.getDateString(1)}%2000%3A00%3A00%27&outFields=Landkreis,Meldedatum,AnzahlFall&outSR=4326&f=json`
this.stateToAbbr = {
@adactio
adactio / sharebutton.js
Last active April 13, 2024 19:22
A polyfill for `button type="share"`
// Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
// http://creativecommons.org/publicdomain/zero/1.0/
/* Use <button type="share"> in your HTML.
Include this JavaScript in a <script> element on the same page or in an external script.
The script checks for three ways of sharing:
1. Native support for <button type="share">.
2. Support for the JavaScript Web Share API.
3. A mailto: link.
This will share the current URL and page title.
@getsource
getsource / junit.xml
Created March 31, 2020 09:38
Test WordPress phpunit `junit.xml` file with failures from PDF disable in `policy.xml`.
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="" tests="10279" assertions="51407" failures="3" errors="1" time="169.605525">
<testsuite name="default" tests="10254" assertions="51160" failures="3" errors="1" time="169.142043">
<testsuite name="Tests_Actions" file="/tmp/wp-current-test/tests/phpunit/tests/actions.php" tests="25" assertions="98" failures="0" errors="0" time="0.102243">
<testcase name="test_simple_action" class="Tests_Actions" file="/tmp/wp-current-test/tests/phpunit/tests/actions.php" line="10" assertions="3" time="0.003842"/>
<testcase name="test_remove_action" class="Tests_Actions" file="/tmp/wp-current-test/tests/phpunit/tests/actions.php" line="27" assertions="4" time="0.003248"/>
<testcase name="test_has_action" class="Tests_Actions" file="/tmp/wp-current-test/tests/phpunit/tests/actions.php" line="46" assertions="6" time="0.002852"/>
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<!-- OPML generated by Fever -->
<head><title>Fever // Project26</title></head>
<body>
<outline type="rss" text="Torsten Landsiedel" title="Torsten Landsiedel" xmlUrl="https://torstenlandsiedel.de/tag/projekt26/feed" htmlUrl="https://torstenlandsiedel.de"/>
<outline type="rss" text="Marc Nilius" title="Marc Nilius" xmlUrl="https://www.wp-wartung24.de/tag/projekt26/feed/" htmlUrl="https://www.wp-wartung24.de"/>
<outline type="rss" text="Stefan Kremer" title="Stefan Kremer" xmlUrl="https://nairobi-notes.de/tag/projekt26/" htmlUrl=""/>
<outline type="rss" text="Ralf Wiechers" title="Ralf Wiechers" xmlUrl="https://blog.drivingralle.de/stichwort/projekt26/feed" htmlUrl="https://blog.drivingralle.de"/>
<outline type="rss" text="Thomas Brühl" title="Thomas Brühl" xmlUrl="https://her.ein.de/tag/projekt26/feed" htmlUrl="https://her.ein.de"/>
@prologic
prologic / post.go
Created December 18, 2019 12:56
A quick 'n dirty MIcroPub Go (Golang) client for Micro.blog (https://micro.blog)
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
<?php
function is_valid_mf2_json($input) {
// Input to this function must be an array
if(!is_array($input))
return false;
// Keys type and properties are required at a minimum and must be arrays
if(!isset($input['type']) || !is_array($input['type']))
return false;
@Zenithar
Zenithar / mastodon.yml
Created April 10, 2017 09:52
OpenAPI / Swagger Mastodon API Specification
swagger: '2.0'
info:
title: Mastodon API
description: API for GNU Social-compatible microblogging server
version: '1.1.1'
contact:
name: Mastodon API Team
url: https://github.com/tootsuite/mastodon
license:
name: AGPL