Skip to content

Instantly share code, notes, and snippets.

View nikita2206's full-sized avatar

Nikita Nefedov nikita2206

  • Amsterdam, Netherlands
View GitHub Profile
@nikita2206
nikita2206 / blueprint.yaml
Created February 10, 2026 21:12
Start Vacuum when everybody leaves house
blueprint:
name: "Vacuum prompt when nobody is home (once per day)"
description: >
When the selected presence entity indicates nobody is home, and this automation
has not fired yet today, send an actionable notification asking whether to
start vacuuming. Tapping the button starts the selected vacuum.
Requirements:
- Home Assistant Companion App on your phones (for actionable notifications).
- A notify service that targets your phones (single phone notify service OR a notify group).

Investigation: How event_detail changed in ft_wms_events

1. How event_detail is built in ft_wms_events

Source → DWH data flow:

  1. WMS service emits operational log events (e.g. replenish_stock, start_replenishment_round) with raw JSON fields like fromLocation, toLocation, object, load_carrier_barcode, etc.

  2. picnic_wms__operational_log_parsed (dbt evt model) normalizes these raw events into a unified JSON structure via a large CASE WHEN event_name = ... block. For each event type, it maps raw fields into standardized keys:

  • replenish_stock: source_hu_idevent_raw:"fromLocation", target_hu_idcoalesce(event_raw:"toLocation", event_raw:"object")
diff --git a/hal/hal_com_phycfg.c b/hal/hal_com_phycfg.c
index 8bb2747..16a85bf 100644
--- a/hal/hal_com_phycfg.c
+++ b/hal/hal_com_phycfg.c
@@ -2575,7 +2575,7 @@ Hal_ChannelPlanToRegulation(
#ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE
extern char *rtw_phy_file_path;
-char file_path[PATH_LENGTH_MAX];
+char rtw_file_path[PATH_LENGTH_MAX];

Hi,

I've been going through some bug reports, and have found there are several bad behaviours related to class constructors that ought to be corrected, but could only be done at a major version. The bad behaviours are:

Constructors returning null

Several classes in PHP return null when there is a problem in the parameters passed to their constructor e.g.

diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 19185df..a4440d9 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -4120,6 +4120,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
&& alias->trait_method->mname_len == fnname_len
&& (zend_binary_strcasecmp(alias->trait_method->method_name, alias->trait_method->mname_len, hash_key->arKey, fnname_len) == 0)) {
fn_copy = *fn;
+ fn_copy.common.function_name = alias->alias;
class ProductController {
protected $productFactory;
public function __construct(ProductFactory $productFactory)
{
$this->productFactory = $productFactory;
}
public function create($product_type)
@nikita2206
nikita2206 / gist:7354392
Created November 7, 2013 13:14
php-src patch for allowing array_unique to take callback as an argument for comparing elements...
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 411e8de..1dcdf76 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -120,6 +120,7 @@ PHP_MINIT_FUNCTION(array) /* {{{ */
REGISTER_LONG_CONSTANT("SORT_LOCALE_STRING", PHP_SORT_LOCALE_STRING, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SORT_NATURAL", PHP_SORT_NATURAL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("SORT_FLAG_CASE", PHP_SORT_FLAG_CASE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("SORT_USERDEFINED", PHP_SORT_USERDEFINED, CONST_CS | CONST_PERSISTENT);
@nikita2206
nikita2206 / gist:5661776
Last active December 17, 2015 19:39
Script for resampling a whole directory of music files recursively. Depends on ffmpeg (better build it with soxr)
<?php
/* config section { */
$input = "F:\\Music";
$output = "F:\\ResampledMusic";
// it will convert all the files to flacs
$ffmpegExecutable = "C:\\users\\nikita\\bin\\ffmpeg";
$ffmpegOptions = "-af aresample=resampler=soxr -ar 44100";
<?php
class Foo
{
public bar()
{
echo "bar\n";
}
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index ccbc9b1..75b2431 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -588,7 +588,7 @@ class_statement:
variable_modifiers { CG(access_type) = Z_LVAL($1.u.constant); } class_variable_declaration ';'
| class_constant_declaration ';'
| trait_use_statement
- | method_modifiers function is_reference T_STRING { zend_do_begin_function_declaration(&$2, &$4, 1, $3.op_type, &$1 TSRMLS_CC); }
+ | method_modifiers method_definition is_reference T_STRING { zend_do_begin_function_declaration(&$2, &$4, 1, $3.op_type, &$1 TSRMLS_CC); }