Skip to content

Instantly share code, notes, and snippets.

@yward
yward / wc_pv_custom_filters.php
Created August 12, 2020 00:43 — forked from Preciousomonze/wc_pv_custom_filters.php
Phone Validator Custom Filters and How to Use 📝
/**
* List of Phone Validator for WooCommerce custom Filters and how to use.
*
* Please feel free to add more to this, and don't forget to add your name to contributors, if you want to.
*
* @author Precious Omonzejele (CodeXplorer 🤾🏽‍♂️🥞🦜🤡)
* @contributors ...add name(s) here
*/
@yward
yward / ssl_on_wamp.pl
Created February 20, 2021 10:48 — forked from muthuishere/ssl_on_wamp.pl
Setup SSL on WAMP for virtual server Virtual hosts on wamp
set WAMP_INSTALL_LOCATION="c:\wamp" #modify
1. Open command prompt as admin Goto %WAMP_INSTALL_LOCATION%\bin\apache\apache2.x.x\bin>
2. Type => set OPENSSL_CONF=%WAMP_INSTALL_LOCATION%\bin\apache\apache2.x.x\conf\openssl.cnf
@yward
yward / wpa-clean-header.php
Created April 4, 2021 06:35 — forked from Auke1810/wpa-clean-header.php
create a clean wordpress header and remove unnecessary clutter.
<?php
/*
Plugin Name: wordpress assist clean header
Plugin URI: http://www.wordpressassist.nl/
Description: Remove shortlink hook
Version: 1.0
Author: AukeJomm
Author URI: http://www.aukejongbloed.nl
*/
@yward
yward / README.md
Created July 18, 2024 19:58 — forked from alexweissman/README.md
Migrating email accounts from a cPanel hosting environment to Mail-in-a-Box

Migrating email accounts from a cPanel hosting environment to Mail-in-a-Box

Part 1: Pregame

  1. Send a mass email to all of your account holders, letting them know that you will be migrating their email accounts to a new server. Send them the instructions from MiaB control panel for connecting to your MiaB server from their mobile/Outlook/Gmail/etc, if applicable. Also, send them a link to the new webmail address. Be sure to give adequate advanced notice (several days, if possible). Advise them to not change their passwords during this time (their passwords will be preserved during migration).
  2. Create a new "test" email account in the MiaB control panel for your domain. This will let MiaB set up the DNS records needed for the domain.

Part 2: Copy credentials

Copy the email account credentials from your cPanel host to MiaB:

@yward
yward / cloudpanel-alias.md
Last active March 5, 2025 05:58
CloudPanel domain alias with separate SSL certificate and shared www dir (Useful for WordPress multisite domain mapping)

While CloudPanel is a great panel, it lacked the ability to add domain aliases or parked domains without manually modifying nginx config files.
Even if you modify the vhost server_name with addon domain, it still shares any SSL certificate with the main domain, which is not optimum for our use case, so below is our solution to have the domain be completely independent (Own SSL, own Vhost file) but share the directory of your main domain as an alias while still using the web interface (mostly) to manage the new alias: \

What is required?
-Main site (let's assume main site document path is /home/mainsite/htdocs/mainsite.com and the username and group are "mainuser")
-Secondary site (we're going to create it following the steps in this Gist) \

Steps:
1-Create a new site (Use any template other than reverse proxy, we recommend PHP).
2-Generate the SSL using let's encrypt for your new site like you'd normal do for any website. \

@yward
yward / freemius.php
Created February 25, 2025 12:17 — forked from thefrosty/freemius.php
Create an override function, as to bypass Freemius in some less than smart plugins.
<?php
declare(strict_types=1);
/**
* Create an override function, as to bypass Freemius in stupid plugins.
* @wordpress-muplugin
* Plugin Name: Freemius Stub
* Description: Global override for Freemius' "loader".
* Version: 1.1.0