Skip to content

Instantly share code, notes, and snippets.

@fevangelou
fevangelou / my.cnf
Last active April 26, 2024 09:12
Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated December 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@fevangelou
fevangelou / my.cnf
Last active April 19, 2024 08:03
Optimized my.cnf configuration for MySQL/MariaDB (on cPanel/WHM servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on cPanel/WHM servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated December 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@alex-wdmg
alex-wdmg / wp_breadcrumbs.php
Last active April 12, 2024 06:21 — forked from Dimox/dimox_breadcrumbs.php
A custom WordPress nav walker class to implement the Bootstrap 4 breadcrumbs style in a custom theme using the WordPress.
<?php
/**
* WP Bootstrap Breadcrumbs
*
* @package WP-Bootstrap-Breadcrumbs
*
* Description: A custom WordPress nav walker class to implement the Bootstrap 4 breadcrumbs style in a custom theme using the WordPress.
* Author: Dimox - @Dimox, Alexsander Vyshnyvetskyy - @alex-wdmg
* Version: 1.1.0
* Author URI: https://github.com/Dimox
@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active January 21, 2024 16:28
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@aslamdoctor
aslamdoctor / wp-ajax-loadmore.md
Last active November 22, 2023 00:41
Wordpress - AJAX Load More Steps

Step 1. Load more button

<?php
global $wp_query; // you can remove this line if everything works for you
 
// don't display the button if there are not enough posts
if (  $wp_query->max_num_pages > 1 )
	echo '<div class="misha_loadmore">More posts</div>'; // you can use <a> as well
?>
@alexandreelise
alexandreelise / README.md
Last active May 29, 2023 21:19
Render All Joomla! 4 Standard Form Fields

j4xall

Render All Joomla! 4 Standard Form Fields using a article layout override. To make it work, you can put this the j4xall.php file at this location:


JPATH_ROOT/templates/cassopeia/html/com_content/article/j4xall.php

@Yiannistaos
Yiannistaos / Joomla-HTMLHelper.php
Last active April 26, 2023 07:53
Quick Intro into the Joomla! HTMLHelper class
<?php
// Quick Intro into the Joomla HTMLHelper class
// Checkout also this video: https://www.youtube.com/watch?v=aHY_hsu7iuk
// File: \libraries\src\HTML\HTMLHelper.php
use Joomla\CMS\HTML\HTMLHelper;
// Image
echo HTMLHelper::_('image', 'plg_system_web357framework/fix404errorlinks.png', Text::_('Fix 404 Error Links extension for Joomla!'), null, true);
echo HTMLHelper::_('image', 'media/plg_system_web357framework/images/fix404errorlinks.png', Text::_('Fix 404 Error Links extension for Joomla!'), null, false);
@kosinix
kosinix / custom-nav-walker-usage.php
Last active April 25, 2023 09:32
WordPress: Using a custom nav walker to create navigation menus in plain <a> tags. That is the <ul> and <li> tags are not present. Very useful if you want to create simple links that can be centered with a simple text-align:center on the containing element.
<?php
// In your template files like footer.php
// The items_wrap value ('%3$s') removes the wrapping <ul>, while the custom walker (Nav_Footer_Walker) removes the <li>'s.
wp_nav_menu(array('items_wrap'=> '%3$s', 'walker' => new Nav_Footer_Walker(), 'container'=>false, 'menu_class' => '', 'theme_location'=>'footer', 'fallback_cb'=>false ));
?>
@otobrglez
otobrglez / i-love-ps.ps1
Created April 14, 2023 09:44
Recursively renaming files with PowerShell
# Oto Brglez - <otobrglez@gmail.com>
$folderPath = "dodo-was-here" | Resolve-Path
Get-ChildItem -Path $folderPath -Recurse -File |
ForEach-Object {
$newName = Join-Path (Split-Path $_.FullName) `
-ChildPath ($_.FullName -replace $folderPath,'' -replace '/|\\','-' -replace '^(.)','')
Rename-Item -Path $_.FullName -NewName $newName -Force # -WhatIf
}