Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthew Hansen mattie02

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am mattie02 on github.
  • I am mattie02 (https://keybase.io/mattie02) on keybase.
  • I have a public key whose fingerprint is 2AC3 D6A0 AC91 FA37 4F12 89F2 58D1 66A0 F981 E59D

To claim this, I am signing this object:

@mattie02
mattie02 / getWorkingDays.php
Last active Aug 29, 2015 — forked from quawn/getWorkingDays.php
PHP: GetWorkingDays excluding weekend and holidays
View getWorkingDays.php
<?php
function getWorkingDays($startDate,$endDate,$holidays) {
// do strtotime calculations just once
$endDate = strtotime($endDate);
$startDate = strtotime($startDate);
//The total number of days between the two dates. We compute the no. of seconds and divide it to 60*60*24
//We add one to inlude both dates in the interval.
$days = ($endDate - $startDate) / 86400 + 1;
View child.js
.maps iframe{
pointer-events: none;
}
jQuery( document ).ready(function($) {
$('.maps').click(function () {
$('.maps iframe').css("pointer-events", "auto");
});
});
View main.css
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
View gist:9f84743685dcca9b7295
function resultsLoop($content = null) {
global $wp_query;
$temp = $wp_query;
$wp_query= null;
$mypost = array(
'post_type' => 'result',
'orderby' => 'menu_order',
'posts_per_page' => '-1',
'order' => 'ASC'
View image-upload-field-custom-taxonomy
<?php
/* Add Image Upload to Series Taxonomy */
// Add Upload fields to "Add New Taxonomy" form
function add_series_image_field() {
// this will add the custom meta field to the add new term page
?>
<div class="form-field">
<label for="series_image"><?php _e( 'Series Image:', 'journey' ); ?></label>
@mattie02
mattie02 / gist:8308341
Created Jan 7, 2014
only pull meta for specific page-template superCpt
View gist:8308341
if(class_exists( 'Super_Custom_Post_Type' )){
add_action( 'after_setup_theme','trusted_page_sup' );
function trusted_page_sup() {
if ( isset( $_GET['post'] ) )
$post_id = $_GET['post'];
elseif ( isset( $_POST['post_ID'] ) )
$post_id = $_POST['post_ID'];
else
$post_id = get_the_ID();
@mattie02
mattie02 / woocommerce-remove-virtual-billing-fields.php
Last active Jan 2, 2016 — forked from BFTrick/woocommerce-remove-virtual-billing-fields.php
For items that are downloadable and have a cost of zero only collects name / email / company
View woocommerce-remove-virtual-billing-fields.php
<?php
/**
* Plugin Name: WooCommerce Remove Billing Fields for Free Virtual Products
* Plugin URI: https://gist.github.com/BFTrick/7873168
* Description: Remove the billing address fields for free virtual orders
* Author: Patrick Rauland
* Author URI: http://patrickrauland.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify
You can’t perform that action at this time.