Skip to content

Instantly share code, notes, and snippets.

View mharis's full-sized avatar

Haris Zulfiqar mharis

View GitHub Profile
@mharis
mharis / 0-intro.md
Created February 28, 2023 22:10 — forked from dwayne/0-intro.md
My notes from the book "Authority by Nathan Barry".

A Step-By-Step Guide To Self-Publishing

Become an expert, build a following, and gain financial independence.

by Nathan Barry

Table of Contents

@mharis
mharis / functions.php
Created November 4, 2022 12:01 — forked from danieliser/functions.php
EDD Subscription Cancellation UX using Gravity Forms & WP Fusion
<?php
/**
* Assumptions:
* - Form ID is #28
* - Page ID is 406200
* - Fields include radio for reason & extra details where needed.
*/
@mharis
mharis / date.format.js
Created October 31, 2022 20:39 — forked from kubiqsk/date.format.js
PHP date() formatting in JavaScript
/*
# this will create new .format() function for Date object
# there is auto localization from Intl, but you can also set language as a 2nd argument
# all possible values were tested and compared on Apache server with PHP 8 date() function
# you can find minified version in the first comment
# examples:
new Date().format('d.m.Y H:i:s') // 25.07.2022 09:11
@mharis
mharis / custom-modal-metabox.js
Created August 23, 2020 06:32 — forked from helgatheviking/custom-modal-metabox.js
Create a completely custom media frame (WIP)
/**
* @type {Object} JavaScript namespace for our application.
*/
var Custom_Modal = {};
(function($, Custom_Modal) {
var $ = jQuery;
_.extend( Custom_Modal, { view: {}, controller: {} } );
@mharis
mharis / FontAwesome-v5.0.9-Free.json
Created January 9, 2020 21:02 — forked from sakalauskas/FontAwesome-v5.0.9-Free.json
List of all Font Awesome 5 icons in JSON Cheetsheet
{
"fas fa-address-book","fas fa-address-card","fas fa-adjust","fas fa-align-center","fas fa-align-justify","fas fa-align-left","fas fa-align-right","fas fa-allergies","fas fa-ambulance","fas fa-american-sign-language-interpreting","fas fa-anchor","fas fa-angle-double-down","fas fa-angle-double-left","fas fa-angle-double-right","fas fa-angle-double-up","fas fa-angle-down","fas fa-angle-left","fas fa-angle-right","fas fa-angle-up","fas fa-archive","fas fa-arrow-alt-circle-down","fas fa-arrow-alt-circle-left","fas fa-arrow-alt-circle-right","fas fa-arrow-alt-circle-up","fas fa-arrow-circle-down","fas fa-arrow-circle-left","fas fa-arrow-circle-right","fas fa-arrow-circle-up","fas fa-arrow-down","fas fa-arrow-left","fas fa-arrow-right","fas fa-arrow-up","fas fa-arrows-alt","fas fa-arrows-alt-h","fas fa-arrows-alt-v","fas fa-assistive-listening-systems","fas fa-asterisk","fas fa-at","fas fa-audio-description","fas fa-backward","fas fa-balance-scale","fas fa-ban","fas fa-band-aid","fas fa-barcode","fas fa-bars",
@mharis
mharis / submenu.js
Created October 19, 2018 19:32
Accessible submenus
/**
* File submenu-toggle.js
*
* Allow submenus to be toggled by keyboard.
*/
window.subMenuToggler = {};
( function( window, $, app ) {
// Constructor.
app.init = function() {
function SMOFtoRedux() {
global $of_options;
$options = $of_options;
$sections = array();
$section = array();
$fields = array();
foreach($options as $key=>$value) {
foreach ($value as $k=>$v) {
if (empty($v)) {
unset($value[$k]);
function generate_options_css($newdata) {
/** Define some vars **/
$data = $newdata;
$uploads = wp_upload_dir();
$css_dir = get_template_directory() . '/css/'; // Shorten code, save 1 call
/** Save on different directory if on multisite **/
if(is_multisite()) {
$aq_uploads_dir = trailingslashit($uploads['basedir']);
} else {
<?php
define( 'THEMENAME', 'Kallyas' );
require_once dirname( __FILE__ ) . '/framework/class-tgm-plugin-activation.php';
add_action( 'tgmpa_register', 'kallyas_register_required_plugins' );
function kallyas_register_required_plugins() {
/**
<?php
/**
* Plugin installation and activation for WordPress themes.
*
* @package TGM-Plugin-Activation
* @version 2.3.6
* @author Thomas Griffin <thomas@thomasgriffinmedia.com>
* @author Gary Jones <gamajo@gamajo.com>
* @copyright Copyright (c) 2012, Thomas Griffin
* @license http://opensource.org/licenses/gpl-2.0.php GPL v2 or later