Skip to content

Instantly share code, notes, and snippets.

View asharirfan's full-sized avatar

Ashar Irfan asharirfan

View GitHub Profile
@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 */
# Packages #
############
*.7z
*.dmg
*.gz
*.bz2
*.iso
*.jar
*.rar
*.tar
@asharirfan
asharirfan / gulpfile.js
Created January 5, 2017 05:03
Gulp file for zipping the plugin directory.
/**
* Gulpfile
*
* @since 1.0.0
*/
/**
* Load Plugins.
*
@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 / custom-permalink-from-meta.php
Created September 6, 2017 11:52 — forked from petenelson/custom-permalink-from-meta.php
WordPress permalink for custom post type based on post meta
@asharirfan
asharirfan / my-plugin.php
Created October 3, 2017 19:10
Basic WordPress Plugin file headers
<?php
/**
* Plugin Name: My Plugin
* Plugin URI: https://my-plugin.com
* Description: A basic WordPress Plugin.
* Version: 1.0.0
* Author: Ashar Irfan
* Author URI: https://asharirfan.com
* Contributors: mrasharirfan
* License: GPL-2.0+
require('babel-register')
const webpack = require('webpack')
const path = require('path')
const I18nPlugin = require("i18n-webpack-plugin")
const merge = require('webpack-merge')
const validate = require('webpack-validator')
const pkg = require('./package.json')
const toHtml = require('vdom-to-html')
const app = require('./app/views/app').default
const parts = require('./webpack.config.parts')
@asharirfan
asharirfan / wpc-hello-world-plugin-headers.php
Last active November 7, 2017 19:14
WPC — Hello World Plugin File Headers
<?php
/**
* Plugin Name: Hello World
* Plugin URI: https://WPCouple.com
* Description: A basic WordPress Plugin.
* Version: 1.0.0
* Author: WPCouple
* Author URI: https://WPCouple.com
* Contributors: WPCouple
* License: GPL-2.0+
@asharirfan
asharirfan / wpc-hello-world.php
Last active November 7, 2017 19:10
WPC — Hello World Plugin Function
<?php
/**
* Hello World.
*
* Display Hello World in WP Admin.
*
* @since 1.0.0
*/
function wpc_hello_world() {
echo '<p>Hello World</p>';
@asharirfan
asharirfan / wpc-functions.php
Created November 9, 2017 15:36
WPC — Add site title to every post title.
<?php
/**
* Add Site Title.
*
* Add site title to every post title.
*
* @param string $title - Title of the post.
*/
function wpc_add_sitename_to_title( $title ) {
// Get the site title.