Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Rude mattrude

View GitHub Profile
@mattrude
mattrude / category-excluder.php
Created Sep 17, 2010
Category Excluder plugin for WordPress
View category-excluder.php
<?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
*/
View remove_plugin_css.php
<?php
add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
function my_deregister_styles() {
wp_deregister_style( 'ninja-annc-css' );
}
?>
View gist:585160
<?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;
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
<?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">
View Translating_WordPress.sh
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 Sep 18, 2010
Translating Edit CSS plugin
View gist:585986
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 <matt@mattrude.com>/'
sed --in-place safecss.pot --expression='s/LANGUAGE <LL@li.org>/Matt Rude <matt@mattrude.com>/'
@mattrude
mattrude / gist:586011
Created Sep 18, 2010
Translating The Random Image Block Plugin
View gist:586011
#!/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 Sep 18, 2010
Translating the mdr-network Plugins
View gist:586057
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 Sep 19, 2010
Importing Translations from glotpress
View custom-css.conf
#!/bin/bash
NAME=custom-css
GIT=custom-css.git
TRANSDIR=mdr-network/custom-css
POTNAME=safecss