Skip to content

Instantly share code, notes, and snippets.


Matt Rude mattrude

View GitHub Profile
mattrude / category-excluder.php
Created Sep 17, 2010
Category Excluder plugin for WordPress
View category-excluder.php
Plugin Name: Category Excluder
Plugin URI:
Description: Allows a user to select the categories they wish to exclude and where they would like to excluded the categories from (main page, feed, archives). See: Tools -> Webmaster Tools
Version: 1.0
Author: Matt Rude
Author URI:
View remove_plugin_css.php
add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
function my_deregister_styles() {
wp_deregister_style( 'ninja-annc-css' );
View gist:585160
function twitter_import() {
require "twitter.lib.php";
$username = "mdrude";
$password = "<password>";
$twitter = new Twitter($username, $password);
$old_id = get_option('milly_twitter_old_id');
$xml = $twitter->getUserTimeline("max_id=$old_id");
$twitter_status = new SimpleXMLElement($xml);
global $user_ID;
View gist:585164
| COMMENT: Remotely reboots a PC. May use machine name or IP address.
On Error Resume Next
mname = InputBox("Enter Machine Name", "Reboot Machine")
If Len(mname) = 0 Then Wscript.Quit
View gist:585183
Using WordPress functions to retrieve the extracted EXIF
information from database
function mdr_exif() { ?>
<div id="exif">
<h3 class='comment-title exif-title'><?php _e('Images EXIF Data'); ?></h3>
<div id="exif-data">
cd /var/www/
rm -rf *
for a in `echo 'fr_FR de_DE pt_PT da_DK it_IT ru_RU'`
mattrude / gist:585986
Created Sep 18, 2010
Translating Edit CSS plugin
View gist:585986
cd /var/www/
rm -rf languages/
mkdir languages
xgettext --keyword=__ --keyword=_e --from-code=php --language=php *.php \
--package-version=1.o --package-name=safecss --output=languages/safecss.pot
cd languages/
sed --in-place safecss.pot --expression='s/YEAR-MO-DA HO:MI+ZONE/2010-09-18 14:57-0500/'
sed --in-place safecss.pot --expression='s/FULL NAME <EMAIL@ADDRESS>/Matt Rude <>/'
sed --in-place safecss.pot --expression='s/LANGUAGE <>/Matt Rude <>/'
mattrude / gist:586011
Created Sep 18, 2010
Translating The Random Image Block Plugin
View gist:586011
cd /var/www/
rm -rf languages
mkdir languages
xgettext --keyword=__ --keyword=_e --from-code=php --language=php *.php \
--package-version=1.o --package-name=safecss --output=languages/random-image-block.pot
cd languages/
sed --in-place random-image-block.pot --expression='s/YEAR-MO-DA HO:MI+ZONE/2010-09-18 14:57-0500/'
mattrude / gist:586057
Created Sep 18, 2010
Translating the mdr-network Plugins
View gist:586057
sleep 2
cd /var/www/
rm -rf languages
mkdir languages
xgettext --keyword=__ --keyword=_e --from-code=php --language=php *.php --package-version=1.o --package-name=mdr-network --output=languages/mdr-network.pot
cd languages/
sed --in-place mdr-network.pot --expression='s/YEAR-MO-DA HO:MI+ZONE/2010-09-18 14:57-0500/'
mattrude / custom-css.conf
Created Sep 19, 2010
Importing Translations from glotpress
View custom-css.conf