Skip to content

Instantly share code, notes, and snippets.

View collegeman's full-sized avatar

Aaron Collegeman collegeman

View GitHub Profile
@collegeman
collegeman / fresh-install.mkd
Created April 29, 2010 19:57 — forked from kennethreitz/fresh-install.mkd
Fresh installation hit list for Mac OSX developers
@collegeman
collegeman / old-date
Created June 30, 2011 18:52
Compare post date to cut off date (for layouts)
<?php
$postDate = strtotime( $post->post_date );
$oldDate = strtotime( '2011-06-29' );
if ( $postDate > $oldDate ) {
echo 'do the new thing';
} else {
echo 'do the old thing';
}
@collegeman
collegeman / gist:1361275
Created November 12, 2011 23:16
Squidmags video player
<?php
$vids_config = array(
'http://youtube.com/?v=whatever This is my first title',
'http://youtube.com/?v=whatever This is my second title',
'http://youtube.com/?v=whatever This is my third title
);
foreach($vids_config as $vid) {
$parts = explode(' ', $vid);
$url = array_shift($parts);
@collegeman
collegeman / youtube-shortcode.php
Created March 6, 2012 17:03 — forked from coreyweb/youtube-shortcode.php
Youtube shortcode for WordPress
<?php
/**
* Youtube Shortcode Solution
*
* Set your desired width for all the videos on your site (below)
* Paste any Youtube video link in the shortcode, using this format, i.e.:
* [youtube value="http://www.youtube.com/watch?feature=player_embedded&v=GGT8ZCTBoBA"]
* This code will automatically resize your video to the appropriate size and aspect ratio.
* Modify the width value (set to 590 here), and the iframe code below to your desired settings.
* This requires coreylib (coreylib.com)
@collegeman
collegeman / wp-recent-posts-by-comments.php
Created May 18, 2012 16:14 — forked from coreyweb/gist:2718955
Recent WordPress Posts by Comment Frequency
<?php
/*
@author Corey Brown https://github.com/coreyweb
This code will display the 10 most commented on posts.
Rules:
- published within the last month
- at least one comment made in the last week
@collegeman
collegeman / vt_resize.php
Created May 21, 2012 13:29 — forked from coreyweb/vt_resize.php
Resize images dynamically using WordPress' built in image manipulation functions.
<?php
/**
* Resize images dynamically using wp built in functions.
* @author Victor Teixeira http://profiles.wordpress.org/vteixeira/
* @author Aaron Collegeman http://aaroncollegeman.com
* @see http://core.trac.wordpress.org/ticket/15311
*
* php 5.2+
*
* Examples: