Skip to content

Instantly share code, notes, and snippets.

View ImonAwesome's full-sized avatar
✔️
Github Verified!

Md. Imon Hossain ImonAwesome

✔️
Github Verified!
View GitHub Profile
@ImonAwesome
ImonAwesome / my-pmpro-redirect-to-referring-page-after-checkout.php
Created March 16, 2024 06:47 — forked from ipokkel/my-pmpro-redirect-to-referring-page-after-checkout.php
Redirect new members and existing members that changes their existing level back to the referring page after checkout.
<?php
/**
* Display the last visited non-PMPro page in the confirmation message, OR
* redirect the member back to the last visited page.
*
* Usage Guide:
*
* 1. Set your preference to either display the link or redirect back to
* the referrer page by setting the $toggle_display_redirect variable
* to true or false.
## Update and Upgrade Repos
sudo su
sudo apt update -y && sudo apt upgrade -y && sudo apt dist-upgrade -y && sudo apt autoremove -y
## Setup SWAP
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1
sudo sh -c 'echo "/var/swap.1 swap swap defaults 0 0 " >> /etc/fstab'
@ImonAwesome
ImonAwesome / Sendy Nginx Config
Last active April 16, 2022 08:26 — forked from amanjuman/Sendy Nginx Config
Sendy Nginx Config for PHP7.4 FPM
sudo su
//Setup Hostname
hostnamectl set-hostname subdomain.domain.tld
## Basic
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get autoremove -y && sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php -y && add-apt-repository ppa:nginx/stable -y
//Setup SWAP
sudo fallocate -l 1G /swapfile;
@ImonAwesome
ImonAwesome / vc-mu_loop.php
Created April 10, 2021 00:24 — forked from Jany-M/vc-mu_loop.php
[WP] Visual Composer custom query loop block / module, for WordPress Multisite
<?php
// There's also a standalone version, no Visual Composer required, purely as a shortcode here https://gist.github.com/Jany-M/d3014a7039c884a8bbd8e8271cfcd982
if( class_exists( 'WPBakeryShortCode' ) && !class_exists( 'vcMUloop' ) ) {
class vcMUloop extends WPBakeryShortCode {
function __construct() {
add_action( 'init', array( $this, 'vc_multisite_mapping' ) );