Skip to content

Instantly share code, notes, and snippets.

View EmranAhmed's full-sized avatar
🏠
Working from home

Emran Ahmed EmranAhmed

🏠
Working from home
View GitHub Profile
@EmranAhmed
EmranAhmed / custom_embed.php
Created October 21, 2018 10:47 — forked from manchumahara/custom_embed.php
Embed in WordPress Outside of Editor or Content https://manchumahara.com/?p=1135&preview=true
$url = 'https://www.youtube.com/watch?v=08f0tiLdk7w'; //a youtube video url
$autoembed = new WP_Embed(); //initialize the wordpress oEmbed helper class
$content = $autoembed->autoembed($url); //let's parse the url and get the embeded content
@EmranAhmed
EmranAhmed / letsencrypt_2018.md
Created February 14, 2019 09:35 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@EmranAhmed
EmranAhmed / update-woo-order-billing-when-user-saves-address.php
Created September 20, 2019 06:31 — forked from zgordon/update-woo-order-billing-when-user-saves-address.php
Update WooCommerce Order Address Dynamically When Customer Updates Their Address
<?php
add_action( 'woocommerce_customer_save_address', 'jsforwp_update_address_for_orders', 10, 2 );
function jsforwp_update_address_for_orders( $user_id ) {
$customer_meta = get_user_meta( $user_id );
$customer_orders = get_posts( array(
'numberposts' => -1,
'meta_key' => '_customer_user',
@EmranAhmed
EmranAhmed / docker-compose.yml
Created November 8, 2022 10:37 — forked from glendaviesnz/docker-compose.yml
Basic WordPress docker compose file
version: '3.7'
services:
mysql:
image: mariadb
ports:
- '3306'
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: wordpress
volumes:
@EmranAhmed
EmranAhmed / README.md
Last active June 18, 2024 14:09 — forked from AminulBD/bootstrap.sh
Ubuntu Server LEMP Setup script

How to Install

  • Download script curl -fsSL https://gist.githubusercontent.com/EmranAhmed/a1a61b710f72317c775715fe1509e99d/raw/bootstrap.sh | bash -s
  • Make it executable chmod +x bootstrap.sh

How to use

  • ./bootstrap.sh --domain=domain.com --user=myname
@EmranAhmed
EmranAhmed / mac-homebrew-lamp.md
Created July 30, 2025 12:37 — forked from kitloong/mac-homebrew-lamp.md
Mac - Install Apache, PHP, MySQL + phpMyAdmin with Homebrew

!!! This guide was created with Macbook Pro M1. Path may vary for different or even same machine.

Install Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Install PHP