Skip to content

Instantly share code, notes, and snippets.

View dexit's full-sized avatar
🎯
Focusing

Rihards Mantejs dexit

🎯
Focusing
View GitHub Profile
@dexit
dexit / gist:6c31fc1e61d5827e7abc5df46d773348
Last active April 7, 2026 09:53
Docker moving partition #devop #dexit

How to Move Docker's Storage Location to an External Drive

Author: nawazdhandala

Tags: Docker, Storage, DevOps, Linux, Docker Daemon

Description: Learn how to relocate Docker's default data directory to an external drive to free up disk space and improve performance.


@dexit
dexit / class.php
Created March 25, 2026 17:19 — forked from hlashbrooke/class.php
A complete, versatile options page class for any WordPress plugin
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
class WordPress_Plugin_Template_Settings {
private $dir;
private $file;
private $assets_dir;
private $assets_url;
private $settings_base;
@dexit
dexit / wp-list-table-custom.php
Created March 25, 2026 17:09 — forked from faiyazalam/wp-list-table-custom.php
WP_List_Table - Custom
<?php
/*
Plugin Name: WordPress - WP_List_Table - Custom
*/
add_action( 'admin_menu','register_my_custom_menu_page');
function register_my_custom_menu_page(){
global $new_menu_page;
// creating admin menu
@dexit
dexit / edit.js
Created March 25, 2026 14:39 — forked from carlodaniele/edit.js
A custom Gutenberg block to add and manage custom meta fields in WordPress
/**
* Retrieves the translation of text.
*
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/
*/
import { __ } from '@wordpress/i18n';
/**
* React hook that is used to mark the block wrapper element.
* It provides all the necessary props like the class name.
@dexit
dexit / servicesldjson-with-books.js
Last active February 9, 2026 16:19
services LD JSON
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Organization",
"name": "Safaraz Ali",
"hasOfferCatalog": {
"@type": "OfferCatalog",
"name": "Canny Bites Business Books",
"url": "https://safaraz.co.uk/canny-bites-business-books/",
"itemListElement": [
@dexit
dexit / elementor-merge-tag-snippet.php
Created February 5, 2026 16:45
elementor merge tag snippet php
<?php
add_filter( 'elementor/widget/render_content', 'insert_wp_variables_in_content' );
function insert_wp_variables_in_content( $content ) {
// This function replaces the placeholders like {{ post_content }} with the corresponding property values from the $post object in the $content variable. Make sure to replace {{ post_id }}, {{ post_title }}, etc., with the appropriate placeholders you want to replace in your content.
// searching in content for this {{ key }} pattern
$pattern = '/\{\{.*?\}\}/';
@dexit
dexit / elementor-table-of-contents-anchor-offset.css
Created February 2, 2026 13:35
elementor table of contents anchor offset css
:root {
scroll-padding-top: 150px!important;
}
@media (max-width: 1024px) {
:root {
scroll-padding-top: 55px;
}
}
@dexit
dexit / download-bigbluebutton-classroom-recording.js
Created January 12, 2026 10:58
download hsoted bigbluebutton classroom recording from chrome console
(async function downloadMeetingRecordings() {
const rows = document.querySelectorAll('#tablewithdata tbody tr');
for (let i = 0; i < rows.length; i++) {
const row = rows[i];
// 1. Extract data from columns
// Column 0: Date, Column 1: Meeting Name, Column 6: Meeting ID
const rawDate = row.cells[0].innerText.trim();
const meetingName = row.cells[1].innerText.trim();
@dexit
dexit / elementor-pro-form-file-upload-folder-by-formid.php
Created December 17, 2025 14:13
elementor-pro-form-file-upload-folder-by-formid.php
<?php
/**
* Change upload folder based on Elementor Form ID
*
* @param $path
* @return string
*/
function zpd_change_elementor_form_upload_path_multi_form( $path ){
if( $_POST[ 'action'] === 'elementor_pro_forms_send_form'){
//The folder name
@dexit
dexit / registration.php
Created December 17, 2025 13:23 — forked from Asikur22/registration.php
Create a User Registration Form in Elementor
/*
* Create new user from Elementor form
*/
add_action( 'elementor_pro/forms/new_record', 'gl_elementor_form_create_new_user', 99, 2 );
function gl_elementor_form_create_new_user( $record, $ajax_handler ) {
$form_id = $record->get_form_settings( 'id' );
if ( 'register_form' !== $form_id ) {
return;
}