Skip to content

Instantly share code, notes, and snippets.

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

Mehedi Hasan mehedi101

🏠
Working from home
View GitHub Profile
@mehedi101
mehedi101 / functions.php
Created May 5, 2017 04:18 — forked from fldtrace/functions.php
Better, Faster, Responsive Images for Divi – Upload in Divi child theme.
<?php
// enable divi functions
add_action( 'wp_enqueue_scripts', 'my_enqueue_assets' );
function my_enqueue_assets() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
}
//add 1440px image size
add_image_size('image_1440', 1440, 9999, false);
@mehedi101
mehedi101 / stripe-checkout.html
Created November 11, 2016 08:26 — forked from ziadoz/stripe-checkout.html
Custom Stripe Checkout Button
<form action="." method="post">
<noscript>You must <a href="http://www.enable-javascript.com" target="_blank">enable JavaScript</a> in your web browser in order to pay via Stripe.</noscript>
<input
type="submit"
value="Pay with Card"
data-key="PUBLISHABLE STRIPE KEY"
data-amount="500"
data-currency="cad"
data-name="Example Company Inc"
@mehedi101
mehedi101 / content-single-product.php
Created October 23, 2016 13:10 — forked from etiennetremel/content-single-product.php
WooCommerce Upsells Upsells as checkbox. When product is deleted from the cart, upsells are also deleted.
<?php
/**
* The template for displaying product content in the single-product.php template
*
* Override this template by copying it to yourtheme/woocommerce/content-single-product.php
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
*/
@mehedi101
mehedi101 / woocommerce_template_loop_add_to_cart
Created August 18, 2016 00:16 — forked from elitteral/woocommerce_template_loop_add_to_cart
Cause Divi to show the Add To Cart buttons on the Shop page when using the WooCommerce plugin
/*
* Divi WordPress Theme and WooCommerce plugin
* Make the Add To Cart buttons appear on the WooCommerce shop page.
*/
add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 20 );
@mehedi101
mehedi101 / countries.php
Created June 11, 2016 05:54 — forked from JeffreyWay/countries.php
Country Names + Codes
[
"United States" => "us",
"Afghanistan" => "af",
"Albania" => "al",
"Algeria" => "dz",
"American Samoa" => "as",
"Andorra" => "ad",
"Angola" => "ad",
"Anguilla" => "ai",
"Antarctica" => "aq",
@mehedi101
mehedi101 / lc-svg-upload.php
Created June 8, 2016 17:26 — forked from Lewiscowles1986/lc-svg-upload.php
SVG Media Plugin for WordPress (Works since 4.1.2!)
<?php
/*
Plugin Name: SVG Upload
Plugin URI: http://www.lewiscowles.co.uk
Description: Super PHP Plugin to add Full SVG Media support to WordPress, I should live in {$webroot}/wp-content/plugins/ folder ;)
Author: Lewis Cowles
Version: 1.5.2
Author URI: http://www.lewiscowles.co.uk/
*/
namespace lewiscowles\WordPress\Compat\FileTypes;
@mehedi101
mehedi101 / navicat_tunnel.php
Created April 11, 2016 05:28 — forked from peterjaap/navicat_tunnel.php
Navicat tunnel file (the nearly unfindable ntunnel_mysql.php)
<?php //version my104
header("Content-Type: application/octet-stream");
error_reporting(0);
set_time_limit(0);
set_magic_quotes_runtime(0);
function phpversion_int()
{
list($maVer, $miVer, $edVer) = split("[/.-]", phpversion());
@mehedi101
mehedi101 / session-life-cycle.md
Last active September 16, 2015 01:04 — forked from mindplay-dk/session-life-cycle.md
Complete overview of the PHP SessionHandler life-cycle

This page provides a full overview of PHP's SessionHandler life-cycle - this was generated by a set of test-scripts, in order to provide an exact overview of when and what you can expect will be called in your custom SessionHandler implementation.

Each example is a separate script being run by a client with cookies enabled.

To the left, you can see the function being called in your script, and to the right, you can see the resulting calls being made to a custom session-handler registed using session_set_save_handler().