Skip to content

Instantly share code, notes, and snippets.

@micahwave
micahwave / gist:5885641
Created June 28, 2013 15:41
vip reblog
<style>
/* <![CDATA[ */
/* Block: reblog */
.reblog-from img { margin: 0 10px 0 0; vertical-align: middle; padding: 0; border: 0; }
.reblogger-note img.avatar { float: left; padding: 0; border: 0; }
.reblogger-note-content { margin: 0 0 20px; }
.reblog-post .wpcom-enhanced-excerpt-content { border-left: 3px solid #eee; padding-left: 15px; }
.reblog-post ul.thumb-list { display: block; list-style: none; margin: 2px 0; padding: 0; clear: both; }
.reblog-post ul.thumb-list li { display: inline; margin: 0; padding: 0 1px; border: 0; }
/**
* API Resources
*/
/*
* Right Now
*
* http://time.com/api/right-now/
* http://time.com/api/right-now/tech/
*/
@micahwave
micahwave / gist:7848034
Created December 7, 2013 20:14
Fix featured images
/**
*
*/
function fix_featured_images() {
// only do 10 at a time
$posts = get_posts( array(
'posts_per_page' => 10,
'post_status' => 'publish',
'meta_query' => array(
register_taxonomy( 'time_section', array( 'post', 'time_sponsored_post', 'time_collection' ), array(
'hierarchical' => false,
'labels' => $section_labels,
'capabilities' => array(
'manage_terms' => 'manage_sections',
'edit_terms' => 'manage_sections',
'delete_terms' => 'manage_sections',
'assign_terms' => 'edit_posts'
),
'rewrite' => array(
function omni_myTemplateLoaded(experienceID) {
player = brightcove.api.getExperience(experienceID);
modVP = player.getModule(brightcove.api.modules.APIModules.VIDEO_PLAYER);
modExp = player.getModule(brightcove.api.modules.APIModules.EXPERIENCE);
modCon = player.getModule(brightcove.api.modules.APIModules.CONTENT);
modAd = player.getModule(brightcove.api.modules.APIModules.ADVERTISING); /* Add advertising module for comScore ad tracking */
modExp.addEventListener(brightcove.api.events.ExperienceEvent.TEMPLATE_READY, onTemplateReady);
}
/**
* Append "Menu" to newly created menus so they slugs dont screw up other taxonomy slugs
*/
function time_nav_menu_filter() {
if( isset( $_POST['menu-name'] ) )
$_POST['menu-name'] .= ' Menu';
}
add_action( 'admin_init', 'time_nav_menu_filter' );
add_rewrite_rule(
'^time/',
'index.php',
'top'
);
comscore: function() {
try {
COMSCORE.beacon({ c1: "2", c2:"6035728"});
} catch(e) {}
// do comscore pv candidate
jQuery.get(
Time.home_url + "/wp-content/themes/vip/time2014/pageview_candidate.xml",
{
# aliases
alias c="clear"
alias g="git"
alias gp="git push"
alias gu="git pull"
alias cdt="cd ~/Dropbox/WordPress/wp-content/themes/vip/time2014"
alias gphm="git push heroku master"
alias ....="cd ../../../"
alias ...="cd ../../"
alias ..="cd ../"
(function(root, factory) {
// Set up Backbone appropriately for the environment.
if (typeof exports !== 'undefined') {
// Node/CommonJS, no need for jQuery in that case.
factory(root, exports, require('underscore'));
} else if (typeof define === 'function' && define.amd) {
// AMD
define(['underscore', 'jquery', 'exports'], function(_, $, exports) {
// Export global even in AMD case in case this script is loaded with
// others that may still expect a global Backbone.