Skip to content

Instantly share code, notes, and snippets.

View FrankM1's full-sized avatar
🎯
Focusing

Franklin Gitonga FrankM1

🎯
Focusing
View GitHub Profile
// Disable WooCommerce styles
function radium_dequeue_css_from_woocommerce() {
wp_dequeue_style( "woocommerce-smallscreen" );
wp_dequeue_style( "woocommerce-layout" );
wp_dequeue_style( "woocommerce-general" );
}
add_action('wp_print_styles', 'radium_dequeue_css_from_woocommerce', 100);
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile
@FrankM1
FrankM1 / TGM plugin activation
Last active March 31, 2019 13:58
TGM plugin modified to support plugin updates by Hogash
<?php
/**
* Plugin installation and activation for WordPress themes.
*
* @package TGM-Plugin-Activation
* @version 2.4.1
* @author Thomas Griffin <thomasgriffinmedia.com>
* @author Gary Jones <gamajo.com>
* @copyright Copyright (c) 2012, Thomas Griffin
* @license http://opensource.org/licenses/gpl-2.0.php GPL v2 or later
<?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() {
/**
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@FrankM1
FrankM1 / LocalValetDriver
Last active November 30, 2018 06:58
Wordpress Multisite Valet Driver
<?php
class LocalValetDriver extends WordPressValetDriver {
/**
* @var string The public web directory, if deeper under the root directory
*/
protected $public_dir = '';
/**
* Determine if the driver serves the request.
@FrankM1
FrankM1 / PHP.sublime-settings
Created August 25, 2017 06:49 — forked from joshearl/PHP.sublime-settings
To enable double-clicking to select PHP variables (including the `$` prefix), save this file as `Data/Packages/User/PHP.sublime-settings`.
{
"word_separators": "./\\()\"'-:,.;<>~!@#%^&*|+=[]{}`~?"
}
@FrankM1
FrankM1 / github.php
Created December 8, 2016 00:10 — forked from ideag/github.php
<?php
define('TOKEN_SECRET', 'plugin_token' );
define('PLUGIN_SLUG', 'plugin_slug' );
EdwinDeployer::parse();
class EdwinDeployer {
public static $json = false;
public static $repo = '';
@FrankM1
FrankM1 / edit.tools.js
Created October 8, 2016 06:51
Elementor hover intent for edit tools
var EditToolsBehavior;
EditToolsBehavior = Marionette.Behavior.extend( {
initialize: function() {
this.listenTo( builder.channels.dataEditMode, 'switch', this.onEditModeSwitched );
},
onEditModeSwitched: function() {
var activeMode = builder.channels.dataEditMode.request( 'activeMode' );
this.view.$el.removeClass( 'builder-element-tools-active', 'preview' === activeMode );