Skip to content

Instantly share code, notes, and snippets.

View asharirfan's full-sized avatar

Ashar Irfan asharirfan

View GitHub Profile
@asharirfan
asharirfan / webhook-mailer.php
Created March 13, 2017 08:03 — forked from boucher/webhook-mailer.php
Stripe Webhook PHP Example
<?php
// SETUP:
// 1. Customize all the settings (stripe api key, email settings, email text)
// 2. Put this code somewhere where it's accessible by a URL on your server.
// 3. Add the URL of that location to the settings at https://manage.stripe.com/#account/webhooks
// 4. Have fun!
// set your secret key: remember to change this to your live secret key in production
// see your keys here https://manage.stripe.com/account
@asharirfan
asharirfan / gulpfile.js
Created January 5, 2017 05:03
Gulp file for zipping the plugin directory.
/**
* Gulpfile
*
* @since 1.0.0
*/
/**
* Load Plugins.
*
# Packages #
############
*.7z
*.dmg
*.gz
*.bz2
*.iso
*.jar
*.rar
*.tar
@asharirfan
asharirfan / _brand-colors.scss
Last active November 11, 2016 14:54
Variables of brand colors in SASS
/**
* Social Media Colors
*/
$facebook: #3b5998; /* Facebook */
$twitter: #1da1f2; /* Twitter */
$linkedin: #0077b5; /* LinkedIn */
$googleplus: #dd4b39; /* Google+ */
$instagram: #000000; /* Instagram */
$skype: #00aff0; /* Skype */
@asharirfan
asharirfan / woocommerce_fix_for_real_homes.php
Last active October 13, 2016 07:57
Place this function inside Real Home theme's/child theme's functions.php file. This function removes select2 JS and CSS of WooCommerce so that Real Homes theme can use its own sources of select2.
<?php
if ( ! function_exists( 'inspiry_fix_select2_wc' ) ) {
/**
* inspiry_fix_select2_wc.
*
* This function removes select2 JS and CSS of WooCommerce
* so that theme can use its own.
*
@asharirfan
asharirfan / woocommerce_fix_for_real_homes.php
Created October 13, 2016 07:40
This function removes select2 JS and CSS of WooCommerce so that Real Homes theme can use its own sources of select2.
<?php
if ( ! function_exists( 'inspiry_fix_select2_wc' ) ) {
/**
* inspiry_fix_select2_wc.
*
* This function removes select2 JS and CSS of WooCommerce
* so that theme can use its own.
*
@asharirfan
asharirfan / override_woocommerce_checkout_fields.php
Last active August 30, 2016 15:47
Function to override the checkout fields of WooCommerce.
<?php
/**
* Function to override the checkout fields of WooCommerce.
*
*/
if ( ! function_exists( 'override_woocommerce_checkout_fields' ) ) {
function override_woocommerce_checkout_fields( $fields ) {
@asharirfan
asharirfan / single-vr_rental.js
Created August 24, 2016 13:56 — forked from ahmadawais/single-vr_rental.js
Owl Carousel: Dynamic Image Pagination on Click
/**
* Click on the pagination thumbnail
* to drag the owlcarosel to a particular clicked image
* and highlight its thumbnail.
*
* @author Ahmad Awais
* @since 1.0.0
*/
$('.vr_carousel__pagDiv').click(function() {
// Efficient $this.
@asharirfan
asharirfan / http_wp_error_fix.php
Created August 22, 2016 17:13
This function removes HTTP error from images while uploading on HTTPS protocol.
<?php
/**
* This function removes HTTP error from images
* while uploading on HTTPS protocol.
*/
if ( !function_exists( 'http_wp_error_fix' ) ) {
function http_wp_error_fix( $array ) {
return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
@asharirfan
asharirfan / sublime-text-settings.json
Created August 19, 2016 06:44
My sublime text settings with Cobalt2 theme.
{
"always_show_minimap_viewport": true,
"auto_upgrade": false,
"bold_folder_labels": false,
"color_scheme": "Packages/Theme - Cobalt2/cobalt2.tmTheme",
"default_line_ending": "unix",
"font_size": 12,
"ignored_packages":
[
"Markdown",