Skip to content

Instantly share code, notes, and snippets.

alhoseany alhoseany

Block or report user

Report or block alhoseany

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View woocommerce-send-custom-email-using-woo-template.php
This script will allow you to send a custom email from anywhere within wordpress
but using the woocommerce template so that your emails look the same.
Created by on 27th of July 2017
Put the script below into a function or anywhere you want to send a custom email
RadGH / capture-acf-form-save-post.php
Last active Jul 1, 2019
Capture a submitted ACF form with fields, and do not create a post out of the data
View capture-acf-form-save-post.php
// Adds a new hook that catches a submitted acf_form by field group key. Only supports a single field group, but could be expanded.
// Just use the new action:
// capture-acf-form/field_group=%%%%%%%%%%%
// Replace %%%%%%% with your field group key.
* Capture user registration form for processing.
duroe5698 / add-custom-menu-item-and-endpoint-to-woocommerce-my-account-page.php
Last active Jun 17, 2019
Add custom menu item and endpoint to WooCommerce my-account page
View add-custom-menu-item-and-endpoint-to-woocommerce-my-account-page.php
/* Add custom menu item and endpoint to WooCommerce My-Account page */
function my_custom_endpoints() {
add_rewrite_endpoint( 'refunds-returns', EP_ROOT | EP_PAGES );
add_action( 'init', 'my_custom_endpoints' );
function my_custom_query_vars( $vars ) {
$vars[] = 'refunds-returns';
noelboss /
Last active Oct 21, 2019
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like or and pull or export it to a production server. Or you use a service like to act upon a Web-Hook that's triggered that service.

timneutkens /
Created Apr 24, 2016
Export / import wordpress database oneliner
# Uses these 2 tools:
# Remote to local
wp ssh db export - --host=production | wp db import -
wp db export - | wp ssh db import - --host=production
shark0der /
Last active Sep 11, 2019 — forked from conroyp/
Mailcatcher installation script for Ubuntu 16.04 (14.04 commands commented out)
# Install dependencies
# older ubuntus
#apt-get install build-essential libsqlite3-dev ruby1.9.1-dev
# xenial
apt install build-essential libsqlite3-dev ruby-dev
# Install the gem
gem install mailcatcher --no-ri --no-rdoc
AmrMekkawy / arabic-country-dropdown-list.html
Created May 17, 2015
Arabic countries HTML "select" element (dropdown list)
View arabic-country-dropdown-list.html
<!-- Country List in Arabic | source: -- >
<select name="country">
<option value="AW">آروبا</option>
<option value="AZ">أذربيجان</option>
<option value="AM">أرمينيا</option>
<option value="ES">أسبانيا</option>
<option value="AU">أستراليا</option>
<option value="AF">أفغانستان</option>
<option value="AL">ألبانيا</option>
<option value="DE">ألمانيا</option>
ranacseruet / VideoStream.php
Last active Oct 18, 2019
PHP VideoStream class for HTML5 video streaming
View VideoStream.php
* Description of VideoStream
* @author Rana
* @link
class VideoStream
private $path = "";
ozh / gist:8169202
Created Dec 29, 2013
Human readable time difference between 2 dates in PHP
View gist:8169202
* Get human readable time difference between 2 dates
* Return difference between 2 dates in year, month, hour, minute or second
* The $precision caps the number of time units used: for instance if
* $time1 - $time2 = 3 days, 4 hours, 12 minutes, 5 seconds
* - with precision = 1 : 3 days
* - with precision = 2 : 3 days, 4 hours
PaulKinlan / criticalcss.html
Last active Sep 30, 2019
Detect Critical CSS
View criticalcss.html
<!DOCTYPE html>
<meta charset=utf-8 />
<title>JS Bin</title>
<h2>Original CSS</h2>
<style style="display: block; white-space: pre; font-family: monospace">
h2 { margin:0; }
You can’t perform that action at this time.