Skip to content

Instantly share code, notes, and snippets.

View zanematthew's full-sized avatar

Zane Matthew zanematthew

View GitHub Profile
@zanematthew
zanematthew / gist:2067880
Created March 18, 2012 02:11
Exiv2 -- XMP Data
$ exiv2 -PXnt images/DSC_6949.jpg
City Hampton
Country USA
State Virgina
rights lang="x-default" Zane M. Kolnik
subject Zane, Day 1, Moto 1
Rating 3
SerialNumber 3034739
Lens AF-S VR Zoom-Nikkor 70-200mm f/2.8G IF-ED
LensID 606370574
@zanematthew
zanematthew / gist:2067884
Created March 18, 2012 02:12
Exiv2 -- Exif Data
$ exiv2 -PEnt images/DSC_6949.jpg
Make NIKON CORPORATION
Model NIKON D300
Orientation top, left
XResolution 72
YResolution 72
ResolutionUnit inch
Software Aperture 3.2.1
DateTime 2011:06:11 13:37:41
ExifTag 204
@zanematthew
zanematthew / gist:2067889
Created March 18, 2012 02:13
Exiv2 -- Lens info Data
$ for i in images/*.jpg ; do exiv2 -PXnt "$i" |grep "Lens " |awk -F" : " '{print $0}' ; done
Lens AF-S VR Zoom-Nikkor 70-200mm f/2.8G IF-ED
Lens AF Nikkor 50mm f/1.4D
Lens AF Nikkor 50mm f/1.4D
Lens AF Nikkor 50mm f/1.4D
Lens AF-S VR Zoom-Nikkor 70-200mm f/2.8G IF-ED
Lens AF-S VR Zoom-Nikkor 70-200mm f/2.8G IF-ED
Lens 30.0-290.0 mm f/4.0-6.3
Lens 30.0-290.0 mm f/4.0-6.3
Lens 30.0-290.0 mm f/4.0-6.3
<?php
function get_state_name_by_abbr( $abbr=null ){
if ( is_null( $abbr ) )
die('need abbr');
$state_list = array(
'AL'=>"Alabama",
'AK'=>"Alaska",
<?php
if ( ! function_exists( 'wp_media_cart_get_the_term_list' ) ) :
function wp_media_cart_get_the_term_list( $attacment_id=null ) {
if ( is_array( $attacment_id ) )
extract( $attacment_id );
$taxonomy = strtolower( trim( str_replace( " ", "-", $taxonomy ) ) );
$terms = wp_get_post_terms( $post_id, $taxonomy );
<?php
/**
* Contains all the methods for manipluating Events "directly", this should extend the db class
*/
Class Event {
/**
* Gets the title to an Event
*
* @param int $event_id
<?php
ini_set('display_errors', 'on');
error_reporting( E_ALL );
/**
* Settings
*/
global $_closure;
global $_p_head_dir;
@zanematthew
zanematthew / gist:2500025
Created April 26, 2012 14:42
Filters for WordPress Template Redirect with Custom Taxonomies and Custom Post Types
<?php
/**
* An "easier" interface for interacting with WordPress' template_redirect function.
*
* @package zm-wordpress-helpers
* @uses is_admin()
* @uses get_query_var()
*/
function bmx_race_schedule_redirect( $params=array() ) {
@zanematthew
zanematthew / gist:2500075
Created April 26, 2012 14:45
Custom action for WordPress Template Redirect
<?php
/**
* Determine if given templates exists if they do loads them
* based on the type of page being displayed.
*
* @uses is_single()
*/
if ( ! function_exists( '_zm_template_redirect' ) ) :
function _zm_template_redirect( $params=array()){
@zanematthew
zanematthew / abstract.php
Created May 2, 2012 13:42
The abstract class for creating Custom Post Types
<?php
/**
*
* This is used to regsiter a custom post type, custom taxonomy and provide template redirecting.
*
* This abstract class defines some base functions for using Custom Post Types. You should not have to
* edit this abstract, only add additional methods if need be. You must use what is provided for you
* in the interface.
*
*/