Skip to content

Instantly share code, notes, and snippets.

View mattrude's full-sized avatar

Matt Rude mattrude

View GitHub Profile
@mattrude
mattrude / category-excluder.php
Created September 17, 2010 22:39
Category Excluder plugin for WordPress
<?php
/**
Plugin Name: Category Excluder
Plugin URI: http://github.com/mattrude/mdr-network
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: http://mattrude.com
*/
<?php
add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
function my_deregister_styles() {
wp_deregister_style( 'ninja-annc-css' );
}
?>
<?php
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;
|==========================================================================
|
| 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
<?php
/*********************************************************************************
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">
@mattrude
mattrude / Translating_WordPress.sh
Created September 18, 2010 06:54
Translating WordPress
cd /var/www/therudes.com/wp-content/languages/
rm -rf *
for a in `echo 'fr_FR de_DE pt_PT da_DK it_IT ru_RU'`
do
wget http://svn.automattic.com/wordpress-i18n/$a/tags/3.0.1/messages/$a.mo
wget http://svn.automattic.com/wordpress-i18n/$a/tags/3.0.1/messages/$a.po
wget http://svn.automattic.com/wordpress-i18n/$a/tags/3.0.1/messages/ms-$a.mo
wget http://svn.automattic.com/wordpress-i18n/$a/tags/3.0.1/messages/ms-$a.po
@mattrude
mattrude / gist:585986
Created September 18, 2010 19:48
Translating Edit CSS plugin
cd /var/www/therudes.com/wp-content/plugins/safecss/
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 <[email protected]>/'
sed --in-place safecss.pot --expression='s/LANGUAGE <[email protected]>/Matt Rude <[email protected]>/'
@mattrude
mattrude / gist:586011
Created September 18, 2010 20:23
Translating The Random Image Block Plugin
#!/bin/bash
cd /var/www/therudes.com/wp-content/plugins/random-image-block/
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
mattrude / gist:586057
Created September 18, 2010 21:33
Translating the mdr-network Plugins
sleep 2
cd /var/www/therudes.com/wp-content/mu-plugins/
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
mattrude / custom-css.conf
Created September 19, 2010 09:40
Importing Translations from glotpress
#!/bin/bash
NAME=custom-css
GIT=custom-css.git
TRANSDIR=mdr-network/custom-css
POTNAME=safecss