Skip to content

Instantly share code, notes, and snippets.

View Ste1io's full-sized avatar

Stelio Kontos Ste1io

View GitHub Profile
@rutger1140
rutger1140 / gist:3794491
Created September 27, 2012 15:03
Wordpress: filter on custom post type taxonomy in admin
function my_restrict_manage_posts() {
global $typenow;
$args=array( 'public' => true, '_builtin' => false );
$post_types = get_post_types($args);
if ( in_array($typenow, $post_types) ) {
$filters = get_object_taxonomies($typenow);
foreach ($filters as $tax_slug) {
$tax_obj = get_taxonomy($tax_slug);
wp_dropdown_categories(array(
'show_option_all' => __('Show All '.$tax_obj->label ),
@SamChristy
SamChristy / gist:1395840
Created November 26, 2011 15:17
A simple high-resolution stopwatch class for timing your programs in a Windows environment.
/////////////////////////////////////////////////////////////////////////
/// Title: Stopwatch Class
/// Author: Sam Christy
/// Date: 26/11/2011
/// Licence: GNU GPL
///
/// This class is a simple, high-resolution stopwatch for timing the
/// execution of C++ programs in a Windows eviroment. This class
/// emulates the Stopwatch class of the .NET framework and uses the
/// Windows API to time events. Its precision is much greater than any