Skip to content

Instantly share code, notes, and snippets.

View zanematthew's full-sized avatar

Zane Matthew zanematthew

View GitHub Profile
<?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
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
function get_state_name_by_abbr( $abbr=null ){
if ( is_null( $abbr ) )
die('need abbr');
$state_list = array(
'AL'=>"Alabama",
'AK'=>"Alaska",
@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
@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: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:2067873
Created March 18, 2012 02:10
Exiv2 -- IPTC Data
$ exiv2 -PInt images/DSC_6949.jpg
CharacterSet G
RecordVersion 2
Copyright Zane M. Kolnik
CountryName USA
City Hampton
ProvinceState Virgina
Keywords Day 1
Keywords Moto 1
Keywords Zane
@zanematthew
zanematthew / gist:2053730
Created March 16, 2012 23:57
BMX RE -- Adding a well structured array of Events.
<?php
/**
* At this point $pages is already a well structured array of solid data,
* which is probally parsed and cleaned. All thats needed from here is
* database insertation. At the moment we're using WordPress, duh. The only
* custom function used here is "add_event_term", which handles some complex
* logic, checking if a term already exists and what not. All other functions
* can be found in the WordPress Codex, http://codex.wordpress.org/
*/
@zanematthew
zanematthew / gist:1970589
Created March 4, 2012 03:48
WordPress Ajax Login -- Load Template
<?php
/**
* loads a template from a specificed path
*
* @package Ajax
*
* @uses load_template()
* @todo move to zm-ajax or something?
*/
function zm_load_template() {
@zanematthew
zanematthew / gist:1970587
Created March 4, 2012 03:47
WordPress Ajax Login -- Form Processor
<?php
/**
* To be used in AJAX submission, gets the $_POST data and logs the user in.
*
* @uses check_ajax_referer()
* @uses wp_signon()
* @uses is_wp_error()
*
* @todo move this to the abtract!
*/