Skip to content

Instantly share code, notes, and snippets.

View MatzeKitt's full-sized avatar

Matthias Kittsteiner MatzeKitt

View GitHub Profile
@MatzeKitt
MatzeKitt / hue-dimmer-switch-blueprint.yaml
Last active July 31, 2024 17:56
ZHA - Philips Hue Dimmer Switch (RWL020, RWL021) for FRITZ!Box
# source: https://community.home-assistant.io/t/zha-philips-hue-dimmer-switch-rwl021-the-fast-easy-way/461969
# No device limitations
blueprint:
domain: automation
name: Controlling lights using Philips Hue Dimmer Switch (RWL021)
description: Take the swith fast into use with pre-set configuration.
input:
zha_device:
name: Philips Hue Dimmer Switch (RWL021 only)
description: The swith to be taken into use.
@MatzeKitt
MatzeKitt / has-d-columns.php
Created October 13, 2023 07:54
Add has-\d-columns class to columns blocks after WordPress 5.3 update.
<?php
/**
* Add has-\d-columns class to columns blocks after 5.3 update.
*
* @param string $block_content The block content about to be appended
* @param array $block The full block, including name and attributes
* @return string The updated block content
*/
add_filter( 'render_block_core/columns', function( $block_content, $block ) {
$columns_count = count( $block['innerBlocks'] );
<?php
namespace wcf\system\cache\builder;
use DateTime;
use wcf\data\visitor\Visitor;
use \wcf\system\WCF;
use wcf\util\StringUtil;
use function array_merge;
use function date_diff;
use function round;
use const TIME_NOW;
<?php
namespace wcf\system\box;
use wcf\system\cache\builder\VisitorCacheBuilder;
use wcf\system\WCF;
use function array_merge;
use function count;
use function ucfirst;
/**
* Implementation of IBoxController for visits.
@MatzeKitt
MatzeKitt / archive.php
Created March 16, 2021 19:42
Zip a directory via PHP with limited memory usage.
<?php
/**
* Configuration
*/
$filename = 'compressed.zip';
$path = '/path/to/store';
// special case for ALL-INKL
// $path = preg_replace( '/(\/www\/htdocs\/\w+\/).*/', '$1', realpath( __FILE__ ) ) . 'subdir';
{
"settings": {
"defaults": {
"color": {
"palette": [
{
"slug": "pale-turquoise",
"color": "#d1f1f1"
}
]
<!-- wp:template-part {"slug":"header","theme":"my-theme"} /-->
theme
|__ block-templates
|__ index.html
|__ block-template-parts
|__ footer.html
|__ header.html
|__ experimental-theme.json
|__ functions.php
|__ index.php
|__ style.css
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-gray; icon-glyph: magic;
// Licence: Robert Koch-Institut (RKI), dl-de/by-2-0
//
// -------------
// Configuration
// -------------
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-gray; icon-glyph: magic;
// Licence: Robert Koch-Institut (RKI), dl-de/by-2-0
//
// -------------
// Configuration
// -------------