Skip to content

Instantly share code, notes, and snippets.

View electricbrick's full-sized avatar

Tom Finley electricbrick

View GitHub Profile
@billerickson
billerickson / gist:1289603
Created October 15, 2011 14:02
Interstrategy Events Manager - Same template for taxonomy
<?php
/**
* Template Redirect
* Use archive-event.php for all events and 'event-category' taxonomy archives.
* @author Bill Erickson
* @link http://www.billerickson.net/code/use-same-template-for-taxonomy-and-cpt-archive/
*
* @param string, default template path
* @return string, modified template path
@billerickson
billerickson / gist:1298344
Created October 19, 2011 13:56
Full Content in Display Posts Shortcode plugin
<?php
/**
* Full Content in Display Posts Shortcode plugin
* @author Bill Erickson
* @link http://wordpress.org/extend/plugins/display-posts-shortcode/
*
* @param string $output the original markup for an individual post
* @param array $atts all the attributes passed to the shortcode
* @param string $image the image part of the output
* @param string $title the title part of the output
@billerickson
billerickson / gist:1303939
Created October 21, 2011 14:04
Modify Date Format in Display Posts Shortcode plugin
<?php
/**
* Modify Date Format in Display Posts Shortcode plugin
* @author Bill Erickson
* @link http://wordpress.org/extend/plugins/display-posts-shortcode/
* @link http://wordpress.org/support/topic/plugin-display-posts-shortcode-show-date-in-format-dmy
*
* @param $output string, the original markup for an individual post
* @param $atts array, all the attributes passed to the shortcode
* @param $image string, the image part of the output
@billerickson
billerickson / gist:1481985
Created December 15, 2011 17:31
Exclude Pages from Genesis Subpages as Secondary Menu plugin
<?php
/**
* Exclude Pages from Genesis Subpages as Secondary Menu plugin
* Use page IDs
*
* @param array $args
* @return array
*/
function be_exclude_pages_from_submenu( $args ) {
@rachelbaker
rachelbaker / genesis-all-posts-by-category-template.php
Created February 16, 2012 14:54
WordPress Genesis Theme Custom Archive Listing Template - All Posts by Category
<?php
/**
* Template Name: Custom Category Archive
*
*
*/
get_header(); ?>
<?php genesis_before_content_sidebar_wrap(); ?>
<div id="content-sidebar-wrap">
<?php genesis_before_content(); ?>
@jcaraballo
jcaraballo / git-branch-between-different-repositories.md
Created March 6, 2012 01:05
How to fork a github repository in bitbucket

#Create bitbucket branch

##Create local branch

$ git checkout -b sync
Switched to a new branch 'sync'
$ git branch
  master
* sync
@luetkemj
luetkemj / wp-query-ref.php
Last active April 25, 2024 09:37
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@billerickson
billerickson / functions.php
Last active October 2, 2015 20:08
Update snippet to include $content and $class parameters
<?php
/**
* Add Read More link to Display Posts Shortcode plugin
* @author Bill Erickson
* @link http://wordpress.org/extend/plugins/display-posts-shortcode/
*
* @param string $output the original markup for an individual post
* @param array $atts all the attributes passed to the shortcode
* @param string $image the image part of the output
* @param string $title the title part of the output
@jo-snips
jo-snips / events-conditional-wrappers.php
Last active December 21, 2023 12:27
The Events Calendar: Basic Conditional Wrappers
<?php
/*-----------------------------------------------------------------------------------*/
/* Conditional Logic to Detect Various Event Related Views/Pages
/*-----------------------------------------------------------------------------------*/
if( tribe_is_month() && !is_tax() ) { // Month View Page
echo 'were on the month view page';
} elseif( tribe_is_month() && is_tax() ) { // Month View Category Page
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs