Skip to content

Instantly share code, notes, and snippets.

View Zodiac1978's full-sized avatar
🤔
Overthinking things since 1978

Torsten Landsiedel Zodiac1978

🤔
Overthinking things since 1978
View GitHub Profile
@Zodiac1978
Zodiac1978 / .htaccess
Created September 4, 2020 13:30
Got an error for "Specify a character set early for .woff2" (https://gtmetrix.com/specify-a-character-set-early.html) - how to fix this in your .htaccess
# MIME Mappings
AddType font/woff .woff
AddType font/woff2 .woff2
@Zodiac1978
Zodiac1978 / q.css
Created August 24, 2020 19:59 — forked from glueckpress/q.css
Localized quotation marks for <q> element.
/* Default quotation mark fallback:
* "This is a quotaion."
*/
q::before {
content: open-quote;
}
q::after {
content: close-quote;
}
@Zodiac1978
Zodiac1978 / custom-pattern.php
Last active May 16, 2021 13:17
Custom Pattern for Antispam Bee: Everything is spam with 6 numbers only *and* yandex.ru or yandex.com in the email field:
<?php
/**
* Plugin Name: Custom Patterns for Antispam Bee
* Description: Add custom patterns for Antispam Bee.
* Plugin URI: https://torstenlandsiedel.de
* Version: 1.0
* Author: Torsten Landsiedel
* Author URI: https://torstenlandsiedel.de
* Licence: GPL 2
* License URI: http://opensource.org/licenses/GPL-2.0
@Zodiac1978
Zodiac1978 / security-header.js
Created August 12, 2020 11:41
WORK IN PROGRESS: wpcheck module to scan for common security headers
/**
* wpcheck module security-header.js
* Scan WordPress URL for common security headers
*/
/**
* Required modules
*/
@Zodiac1978
Zodiac1978 / blocklist-to-spam.php
Last active July 12, 2020 20:06
Comments blocked by the blocklist should be spam and not trash. Companion plugin for Antispam Bee.
<?php
/**
* Plugin Name: Blocklist to spam
* Description: Comments blocked by the blocklist should be spam and not trash.
* 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
## Find ttl for IPv4 record ##
dig +nocmd +noall +answer +ttlid a example.org
## Find ttl for IPv6 record ##
dig +nocmd +noall +answer +ttlid aaaa example.org
@Zodiac1978
Zodiac1978 / functions.php
Created January 19, 2020 14:21
Remove events from a specified event category in "The Events Calendar" by Modern Tribe
<?php
/**
* The Events Calendar Remove Events from Month and List Views
*
* @param [object] $query Query of the events page.
* @return [object] Modified Query
*/
function tribe_exclude_events_category_month_list( $query ) {
if ( isset( $query->query_vars['eventDisplay'] ) && ! is_singular( 'tribe_events' ) ) {
@Zodiac1978
Zodiac1978 / projekt26-2020.md
Last active January 21, 2022 22:55
Teilnehmerinnen und Teilnehmer sowie alle Beiträge zur #Projekt26 Challenge im Jahr 2020

Am 28.12. habe ich mit einem Tweet zur #Projekt26 Challenge herausgefordert. Alle zwei Wochen bloggen und kommentieren, über Wordpress oder Verwandtes, in Deutsch oder Englisch. Alle Details dazu in diesem Artikel: https://torstenlandsiedel.de/2019/12/28/projekt26-jetzt-erst-recht/

Für 2021 geht es hier weiter: https://gist.github.com/Zodiac1978/2f13339f8431d1e5edf3365c39bdb12d

KW 1+2

@Zodiac1978
Zodiac1978 / repair-bytes.php
Last active January 13, 2023 13:39
Sometimes the server config return bytes (instead of MB), this little helper fixes the display in the site health plugin.
<?php
/**
* Returns always bytes for every config (M, K or G)
*
* @param [string] $size_str Input from config.
* @return [int] Return in bytes.
*/
function return_bytes( $size_str ) {
switch ( substr( $size_str, -1 ) ) {
@Zodiac1978
Zodiac1978 / check-intl.php
Created June 22, 2019 05:21
Adds an additional check to the Site Health plugin for the intl (internationalization) module
<?php
/**
* Filter PHP modules for testing
*
* @package Normalizer
*/
/**
* Plugin Name: Check for intl PHP module
* Description: Add intl module for testing in Site Health