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
<?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 craig@123marbella.com on 27th of July 2017
Put the script below into a function or anywhere you want to send a custom email
*/
@RadGH
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
<?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
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
noelboss / git-deployment.md
Last active Oct 21, 2019
Simple automated GIT Deployment using Hooks
View git-deployment.md

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 github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@timneutkens
timneutkens / wordpress-dbsync.sh
Created Apr 24, 2016
Export / import wordpress database oneliner
View wordpress-dbsync.sh
# Uses these 2 tools:
# http://wp-cli.org/
# https://github.com/xwp/wp-cli-ssh
# Remote to local
wp ssh db export - --host=production | wp db import -
# Local to remote BEWARE THIS IS DANGEROUS BUT KEPT AS REFERENCE
wp db export - | wp ssh db import - --host=production
@shark0der
shark0der / setup_mailcatcher.sh
Last active Sep 11, 2019 — forked from conroyp/setup_mailcatcher.sh
Mailcatcher installation script for Ubuntu 16.04 (14.04 commands commented out)
View setup_mailcatcher.sh
#!/bin/bash
# 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
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: https://github.com/umpirsky/country-list -- >
<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
ranacseruet / VideoStream.php
Last active Oct 18, 2019
PHP VideoStream class for HTML5 video streaming
View VideoStream.php
<?php
/**
* Description of VideoStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
*/
class VideoStream
{
private $path = "";
@ozh
ozh / gist:8169202
Created Dec 29, 2013
Human readable time difference between 2 dates in PHP
View gist:8169202
<?php
/**
* 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
PaulKinlan / criticalcss.html
Last active Sep 30, 2019
Detect Critical CSS
View criticalcss.html
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<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.