Skip to content

Instantly share code, notes, and snippets.

View mralaminahamed's full-sized avatar
💻
Always available

Al Amin Ahamed mralaminahamed

💻
Always available
View GitHub Profile
@mralaminahamed
mralaminahamed / gist:5b65ee92429137fcf9c0946a86dade86
Created September 27, 2025 07:49 — forked from marrisonlab/gist:2d2b1e2423312076256e9def70ff931a
Display Dokan Vendor meta in single product page and loop
/**
* Snippet unificato Dokan + Vendor
* Funziona sia con ID utente generico che con loop prodotto
* WPCode: PHP Snippet → Run Everywhere
*/
if ( ! function_exists( 'sn_get_product_from_context' ) ) {
function sn_get_product_from_context() {
global $product;
if ( isset( $product ) && is_object( $product ) ) return $product;

Our lives are increasingly intertwined with technology, the storage space on our devices becomes a valuable commodity. Mac users often find themselves grappling with the perennial issue of managing storage space efficiently. Accumulated files, applications, and system clutter can clog up your Mac's storage, slowing down performance and hindering productivity.

In this guide, we'll use the built-in Terminal app to free up space on your Mac without using any third-party software.

1. Empty the Trash

Start by emptying the Trash. Even though this can be done through the Finder, you can also do it via Terminal using the rm command.

sudo rm -rf ~/.Trash/*

@mralaminahamed
mralaminahamed / class.php
Created March 5, 2025 19:42 — forked from igorbenic/class.php
How to create a Custom WooCommerce Email | https://www.ibenic.com/create-custom-woocommerce-email
<?php
/**
* Class Custom_WC_Email
*/
class Custom_WC_Email {
/**
* Custom_WC_Email constructor.
@mralaminahamed
mralaminahamed / config.php
Created February 17, 2025 01:17 — forked from Niloys7/config.php
one click demo import (OCDI) is not adding elementor global options
/**
* Function to perform setup after importing data.
* This function assigns the front page and the posts page (blog page) based on the imported demo.
* @param array $selected_import The selected import data.
* @link https://www.codeixer.com/addressing-the-issue-of-one-click-demo-import-not-add-elementor-global-options/
*/
function cdx_after_import_setup( $selected_import ) {
// Import Elementor kit data.
@mralaminahamed
mralaminahamed / update_phpstorm_eap.sh
Last active October 2, 2024 14:33 — forked from DarkaOnLine/php-storm-eap-update.sh
This script automates the process of updating PhpStorm EAP version. It downloads the latest EAP build and installs it on your system.
#!/usr/bin/env bash
#####################################################################
# PhpStorm EAP Updater Script
#
# This script automates the process of updating PhpStorm EAP version.
# It fetches the latest EAP build information, allows the user to choose
# the download format, and installs it on your system.
#
# Usage:
@mralaminahamed
mralaminahamed / gist:27bf6e167b52aacfa0636dc80d1e76dc
Created July 10, 2024 08:37 — forked from mikejolley/gist:3b37b9cc19a774665f31
Example instance based shipping method
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Sample instance based method.
*/
class WC_Shipping_Test_Method extends WC_Shipping_Method {
@mralaminahamed
mralaminahamed / wp-cli-wc-import-csv.php
Created June 27, 2024 08:01 — forked from britweb-tim/wp-cli-wc-import-csv.php
Add a WP CLI Command for importing woocommerce products from csv
<?php
/**
* Plugin Name: WP CLI Command (import of CSV)
* Description: Add a WP CLI Command which allows import of CSV files from the command line.
* Version: 1.0
* Author: WP Squad
* Author URI: https://thewpsquad.com
*/
@mralaminahamed
mralaminahamed / postman-deb.sh
Created May 25, 2024 09:02 — forked from SanderTheDragon/postman-deb.sh
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
# SPDX-FileCopyrightText: 2017-2024 SanderTheDragon <sanderthedragon@zoho.com>
#
# SPDX-License-Identifier: MIT
arch=$(dpkg --print-architecture)
echo "Detected architecture: $arch"
case "$arch" in
@mralaminahamed
mralaminahamed / gist:ab85f8b01734d44c42ab40dfb36aa94e
Created October 5, 2021 06:44 — forked from jcsrb/gist:1081548
get avatar from google profiles, facebook, gravatar, twitter, tumblr
function get_avatar_from_service(service, userid, size) {
// this return the url that redirects to the according user image/avatar/profile picture
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px )
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word )
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px )
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word )
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px )
// everything else will go to the fallback
// google and gravatar scale the avatar to any site, others will guided to the next best version
@mralaminahamed
mralaminahamed / ohmyzsh.md
Created April 15, 2021 22:09 — forked from yovko/ohmyzsh.md
ZSH (using Oh My ZSH) on Manjaro Linux

ZSH (using Oh My ZSH) on Manjaro Linux

0. If ZSH is not already installed on your Manjaro system you can do it with the command:

sudo pacman -Syu zsh

You do not need to install manjaro-zsh-config and all the other related packages like zsh-syntax-highlighting, zsh-history-substring-search, zsh-autosuggestions, etc., as we will use Oh My Zsh.