Skip to content

Instantly share code, notes, and snippets.

View dexit's full-sized avatar
🎯
Focusing

Rihards Mantejs dexit

🎯
Focusing
View GitHub Profile
<?php
use Psr\Http\Message\ResponseInterface;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Client;
@dexit
dexit / data.yaml
Last active May 27, 2026 14:57
displayadverapi.json
openapi: 3.0.1
info:
title: Display Advert API
description: |-
Get and display adverts from Find an apprenticeship.
**Note.** It is not recommended to use The Display Advert API directly from a browser and as such we have not enabled CORS for this API. Instead, we recommend you call the API intermittently to retrieve the latest vacancies, store those vacancies in your own data store, and then change your website to read those vacancies from your own data store.
version: '2'
servers:
- url: https://api.apprenticeships.education.gov.uk/vacancies
paths:
- CPT Title Capitalisation (Page, Post, Product etc)
- Page title length trim - https://wordpress.org/plugins/cpt-post-title-trimer/ or https://wordpress.org/plugins/limit-characters-in-title/
- Post title length trim - https://wordpress.org/plugins/cpt-post-title-trimer/ or https://wordpress.org/plugins/limit-characters-in-title/
- Product title length trim - https://wordpress.org/plugins/cpt-post-title-trimer/ or https://wordpress.org/plugins/limit-characters-in-title/
- Taxonomy title length htrim - https://wordpress.org/plugins/cpt-post-title-trimer/ or https://wordpress.org/plugins/limit-characters-in-title/
- Page title unique check - https://wordpress.org/plugins/unique-title-checker/
- Post title unique check - https://wordpress.org/plugins/unique-title-checker/
- Product title unique check - https://wordpress.org/plugins/unique-title-checker/
- Meta Title - trim by standard full compatability with Yoast
@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;
}
}