Skip to content

Instantly share code, notes, and snippets.

@gustavorv86
gustavorv86 / samba-server-for-xiaomi-cameras.md
Last active November 20, 2025 08:39
How to configure a low-cost NAS server for a Xiaomi MI Home Security Camera

Samba Server configuration for Xiaomi MI Home Security Camera

This manual explains how to set up a low-cost NAS server to store videos from a Xiaomi camera, model MI Security Camera.

You can use a development board Linux based such as Raspberry PI or similar, an old PC, Barebone etc.

NAS Server Configuration

Install samba.

@Crocoblock
Crocoblock / current-object-property-macro.php
Last active December 4, 2025 12:03
JetEngine Get current object propery macro
<?php
add_action( 'jet-engine/register-macros', function(){
/**
* Return current object property.
*/
class Current_Object_Prop_Macro extends \Jet_Engine_Base_Macros {
/**
@ihslimn
ihslimn / gist:aeb76a778ed44d32faf640f4d3bda8ea
Created May 6, 2022 13:52
Get properties from query macro
//add Get properties from query macro
add_filter( 'jet-engine/listings/macros-list', 'register_query_items_macro' );
function register_query_items_macro( $macros_list ) {
$macros_list['get_props_from_query'] = array(
'label' => 'Get properties from query',
'cb' => 'get_props_from_query_macro',
'args' => array(
'query_id' => array(
@MjHead
MjHead / jet-engine-cct-api.php
Last active November 19, 2024 16:30
API to interact with JetEngine CCT from directly PHP code
<?php
/**
* JetEngine CCT-related API functions to use in theme or plugin
*
* Theme usage - include get_theme_file_path( 'jet-engine-cct-api.php' );
* Plugin usage - include PLUGIN_PATH . 'path-to-file-inside-plugin/jet-engine-cct-api.php';
*/
/**
@BODA82
BODA82 / wp-custom-post-type-as-submenu-item.php
Last active November 14, 2024 05:56
Add WordPress custom post type as submenu item of existing admin menu.
<?php
if (! function_exists('gist_register_cpt')) {
/**
* Register Custom Post Type
*/
function gist_register_cpt() {
// Set CPT labels
$labels = array(