Skip to content

Instantly share code, notes, and snippets.

View carstingaxion's full-sized avatar

Carsten Bach carstingaxion

View GitHub Profile
<?php
/*
Plugin Name: GatherPress RSVP Action
Description: Sends an email, whenever someone sends an RSVP
Version: 0.0.1
Author: Carsten Bach
*/
/**
* Fires immediately after a comment is inserted into the database.

erDiagram POST { int post_id varchar title text content datetime date } COMMENT { int comment_id int post_id

@carstingaxion
carstingaxion / Inclusive_author.php
Last active May 16, 2024 16:05
gettext_domain filter example to prepare twentysixteen theme for more inclusive language
<?php
add_filter( 'gettext_twentysixteen', 'make_twentysixteen_author_more_inclusive', 10, 3 );
/**
* Code snippet to make the "Author:" text in the Twentysixteen theme more inclusive
*
* @link https://developer.wordpress.org/reference/hooks/gettext_domain/
* @link https://github.com/WordPress/twentysixteen/blob/master/template-parts/biography.php#L28
*/
function make_twentysixteen_author_more_inclusive( $translated_text, $text, $domain ) {
@carstingaxion
carstingaxion / children-hospitalization.md
Created March 19, 2023 16:17
Statistika aus dem "mental-healft" der Figurentheaterproduktion "Der schwarze Hund"
pie
    title Gründe für Krankenhausaufenthalte von Kindern und Jugendlichen
    "Psychische Erkrankungen" : 40
    "Körperliche Erkrankungen" : 30
    "Unfälle und Verletzungen" : 20
    "Andere Gründe" : 10
@carstingaxion
carstingaxion / 01-run-1.md
Last active March 4, 2023 06:45
Thunderbird [try to] Signature Update Plugin

Run 1

How should the code for a working plugin for the current version of thunderbird look, that allows a user to set an external URL, from which the referenced default signature gets updated once a day. The URL points to a html page, which should be downloaded and safed. Automatically set the downloaded file as the source for the signature, which gets added to every email by default. The code should follow all relevant coding-standards and best-practices for thunderbird plugins.

@carstingaxion
carstingaxion / links-in-mermaid.md
Last active February 16, 2023 10:54
Two ways to write a link in mermaid.js
@carstingaxion
carstingaxion / user-registration-flow.md
Last active February 16, 2023 10:53
Testing mermaid.js
graph TD
    User[user] -->|enters data| mft(mein.f.t)
    mft --> |persist| DB[(temporary user-registration<br/> data saved in wp_users)]
    Admin(admin) --> |approve user| DB
    DB -->|address| Nominatim{Nominatim API}
    Nominatim -->|valid| D[geoJSON]
    Nominatim -->|invalid| E[fa:fa-ban]
@carstingaxion
carstingaxion / check_xhprof_sample_enable.php
Created January 5, 2023 23:16
Check for xhprof_sample_enable()
<?php
echo '<p>Calling to <code>xhprof_sample_enable()</code>.</p>' . PHP_EOL;
if (function_exists('xhprof_sample_enable')) {
xhprof_sample_enable();
} else {
echo '<p style="color: red;">This server does not support <code>xhprof_sample_enable()</code> function.</p>' . PHP_EOL;
echo 'Exit now.<br>' . PHP_EOL;
exit();
@carstingaxion
carstingaxion / check_sqlite3.php
Created January 5, 2023 23:14
Check for sqlite3 extension
<?php
if ( class_exists('SQLite3') ) {
echo 'SQLite3 class loaded'. "\n\n";
}
if ( extension_loaded('sqlite3') ) {
echo 'sqlite3 extension loaded'. "\n\n";
}