This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Pew Serial Array Search and Replace | |
Description: Search and replace values in serialized arrays in specific tables. Thanks to http://interconnectit.com/124/search-and-replace-for-wordpress-databases/ for sharing. | |
Version: 1.0 | |
Author: Russell Heimlich | |
Author URI: http://www.russellheimlich.com | |
*/ | |
/********************/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We have a private Git running on a server somewhere which we consider our central repository. Inside the .git/hooks/post-recieve is the following: | |
#!/bin/bash | |
while read oldrev newrev ref | |
do | |
branch=`echo $ref | cut -d/ -f3` | |
if [ "master" == "$branch" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('the_excerpt', 'we_aint_got_time_for_more'); | |
function we_aint_got_time_for_more($the_original_excerpt) { | |
global $post; | |
return explode('<!--more-->', $post->post_content)[0]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//BWP Google Sitemap Plugin doesn't add sitemap links to robots.txt files so I guess I'll do it myself... | |
function pew_add_sitemap_urls_to_robots_txt() { | |
echo "\nSitemap: " . get_site_url() . "/sitemap.xml"; | |
echo "\nSitemap: " . get_site_url() . "/post_google_news.xml"; | |
echo "\n\n"; | |
return $txt; | |
} | |
add_action( 'do_robotstxt', 'pew_add_sitemap_urls_to_robots_txt' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: RH CDN Integration | |
Description: Making Origin Pull Work. Heavilty inspired by https://github.com/markjaquith/WP-Stack/blob/master/WordPress-Dropins/wp-stack-cdn.php | |
Version: 0.1 | |
Author: Russell Heimlich | |
Author URI: http://www.russellheimlich.com | |
*/ | |
// Convenience methods |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function() { | |
//Set-up some constants. | |
var scrollTimeout; | |
var scrollUsePushStateInstead = false; //Set to true to make the history stack of the browser include every point when posts were loaded. It's kind of annoying. | |
var scrollDelay = 200; //Milliseconds | |
var scrollLoading = false; | |
var triggerOffset = $(document).height() - $('#pagination').siblings().eq(-4).offset().top; //The point of this is to do one calculation up front instead of multiple calculations every time the infinite scroll is triggered. | |
// Simple feature detection for History Management (borrowed from Modernizr) | |
function supportsHistory() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Pew Scripts | |
Description: Scripts that are used on multiple sites can be registered and maintained in one place through this plugin. | |
Version: 1.2 | |
Author: Russell Heimlich | |
Author URI: http://www.russellheimlich.com | |
*/ | |
function pew_register_global_scripts() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function chris_coyiers_super_awesome_feed_image_magic( $content ) { | |
$doc = new DOMDocument(); | |
$doc->LoadHTML( $content ); | |
$images = $doc->getElementsByTagName('img'); | |
foreach ($images as $image) { | |
// Set the new attribute. | |
$image->setAttribute( 'style', 'max-width:480px;' ); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery( document ).ready( function($) { | |
var csv = "data:text/csv;charset=utf-8,"; | |
var csvData = []; | |
$('#content .post').each(function() { | |
$this = $(this); | |
csvData.push( [this.href, $this.find('h2').text(), $this.find('.meta span:last-of-type').text() ] ); | |
}); | |
for( i=0; i < csvData.length; i++ ) { | |
var row = '"' + csvData[i].join('","') + '"'; |
OlderNewer