Skip to content

Instantly share code, notes, and snippets.

View dwainm's full-sized avatar
💸
WooCommerce Payments https://woocommerce.com/payments/

Dwain Maralack dwainm

💸
WooCommerce Payments https://woocommerce.com/payments/
View GitHub Profile
add_action( 'sensei_before_main_content', 'sensei_conditional_lesson_display', 10 );
function sensei_conditional_lesson_display() {
if( !is_singular('course') ) return;
global $post, $current_user, $woothemes_sensei, $sensei_modules;
$is_user_taking_course = WooThemes_Sensei_Utils::user_started_course( $post->ID, $current_user->ID );
if ( ! ( $is_user_taking_course || sensei_all_access() ) ) {
remove_action( 'sensei_course_single_lessons', 'course_single_lessons', 10 );

OS X Preferences


#Disable window animations
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false

#Enable repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
@dwainm
dwainm / gist:a60340429d206d145db6
Last active August 29, 2015 14:13 — forked from growdev/gist:ad915038172511975fbd
Remove the WooThemes helper admin notice.
<?php
add_action( 'init', 'custom_remove_helper_admin_notice' );
/**
* Remove the Woothemes Helper admin install notice
*/
function custom_remove_helper_admin_notice() {
remove_action( 'admin_notices', 'woothemes_updater_notice' );
}
@dwainm
dwainm / functions.php
Created January 20, 2015 08:25
Sensei Integration for the Carry-Hill theme. To use this simply copy the following code into your functions.php file.
/**
* Sensei Carry-Hill theme integration
*/
// declaring Sensei support
add_action( 'after_setup_theme', 'declare_sensei_support' );
function declare_sensei_support() {
add_theme_support( 'sensei' );
}
@dwainm
dwainm / gist:fa7e54604aab97acea10
Created September 2, 2014 01:51
demo table data for canvas theme responsive table bug
<table>
<tbody>
<tr>
<td colspan="4">
<h5 class="tdbkg">ARTS, MEDIA &amp; ENTERTAINMENT</h5>
</td>
</tr>
<tr>
<td colspan="4">
<h2 class="nameclass"><strong>GRAPHIC DESIGN</strong></h2>
@dwainm
dwainm / functions.php
Created July 24, 2014 00:29
Programatically create multiple posts for the given post type. This function runs on every page reload so be sure to run it only once
function programmatically_create_multiple_posts() {
// Initialize the page ID to -1. This indicates no action has been taken.
$post_id = -1;
$numberofposts = 40;
$new_post_type = 'portfolio';
for ($i=0; $i < $numberofposts; $i++) {
// Setup the author, slug, and title for the post
<?php
/*-----------------------------------------------------------------------------------*/
/* Start WooThemes Functions - Please refrain from editing this section */
/*-----------------------------------------------------------------------------------*/
// Set path to WooFramework and theme specific functions
$functions_path = get_template_directory() . '/functions/';
$includes_path = get_template_directory() . '/includes/';
#main-nav{
margin: 0 auto;
width: 87%;
float: none !important;
}
@dwainm
dwainm / LoadingTitle.js
Last active August 29, 2015 14:02
Javascript snippet for changing the site title into an animated Loading...
/**
* author: Dwain Maralack http://github.com/dwainm/
*
* to stop this run: stopLoadTitle()
*/
var timer = 0 ;
var loadingHandle;
var title = document.getElementsByTagName('title')[0];
var oldTitle = title.innerHTML;
@dwainm
dwainm / gist:b656be618d47f34abb9e
Created June 18, 2014 13:21
(18 Jun 2014) replace the content here with this file stitched / includes / js / general.min.js
jQuery(document).ready(function(e){jQuery(".entry table tr:odd").addClass("alt-table-row"),jQuery(".post, .widget, .panel, .page").fitVids(),jQuery(".nav-toggle").click(function(e){e.preventDefault(),jQuery("body").toggleClass("show-nav"),jQuery("#navigation").find(".top-navigation").size()||jQuery("#top .top-navigation").clone().appendTo("#navigation .menus")}),jQuery(".nav-close").click(function(e){e.preventDefault(),jQuery("body").removeClass("show-nav")});var t=function(e,t){if(e)do{if(e.id===t)return!0;if(9===e.nodeType)break}while(e=e.parentNode);return!1};jQuery(window).width()<767&&(jQuery("body")[0].addEventListener?document.addEventListener("touchstart",function(e){jQuery("body").hasClass("show-nav")&&!t(e.target,"navigation")&&(e.preventDefault(),jQuery("body").removeClass("show-nav"))},!1):jQuery("body")[0].attachEvent&&document.attachEvent("ontouchstart",function(e){jQuery("body").hasClass("show-nav")&&!t(e.target,"navigation")&&(e.preventDefault(),jQuery("body").removeClass("show-nav"))})),/Andr