Skip to content

Instantly share code, notes, and snippets.

View carstingaxion's full-sized avatar

Carsten Bach carstingaxion

View GitHub Profile
@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";
}
@carstingaxion
carstingaxion / check_fastcgi.php
Created January 5, 2023 23:12
Check for support of fastcgi_finish_request()
<?php
$file = __DIR__ . '/text.txt';
if (is_file($file) && is_writable($file)) {
@unlink($file);
echo '<small style="color: #ccc;">' . $file . ' was deleted.</small><br>' . PHP_EOL;
}
echo '<p>Calling to <code>fastcgi_finish_request()</code>.</p>' . PHP_EOL;
@carstingaxion
carstingaxion / cbstdsys_add-icon-classes-to-post-classes-obj.php
Created May 15, 2014 11:57
Add CSS icon classes to post-class object by post_type and post-format
function cbstdsys_add_icon_classes_by_post_type_and_format( $classes ) {
global $post;
switch ( $post->post_type ) {
case 'post' :
if ( is_sticky( $post->ID ) ) {
$classes[] = 'icon-alert';
return $classes;
}
@carstingaxion
carstingaxion / cbstdsys_sw_social-stuff-for-functions.php
Created May 12, 2014 21:24
Social (Mailchimp) related defaults for functions.php
/** SOCIAL - by Mailchimp **/
// Disable default CSS and JS for the Social plugin
define('SOCIAL_COMMENTS_CSS', false);
define('SOCIAL_COMMENTS_JS', false);
// Define custom comments file for Social plugin
define('SOCIAL_COMMENTS_FILE', get_stylesheet_directory().'/social-comments.php');
@carstingaxion
carstingaxion / cbstdsys_sw_wpml-stuff-for-functions.php
Created May 12, 2014 21:22
WPML related defaults for functions.php
/** WPML - Sitepress Multilingual CMS **/
global $sitepress;
// remove language switcher, 'cause it messes with the WP backend styles
remove_action('in_admin_header', array($sitepress, 'admin_language_switcher'));
// remove meta-generator tag
remove_action('wp_head', array($sitepress, 'meta_generator_tag'));
// WPML sitepress-multilingual-cms
define( 'ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS' , true);