zoombody

by Dan Rice

 

Styling WordPress 2.7 author comments

Styling post author or registered user comments on your WordPress 2.7 blog is much easier than it was back in ol’ 2.6. The new wp_list_comments() template tag (or comment_class() if you’re doing it the hard way) automatically includes class names like byuser and bypostauthor for easy CSS styling. Slick.

See the official 2.7 theme migration guide for more details.

Comment on this article »



 

Hide yourself from your own website’s Google Analytics using Firefox

The latest version of Firefox add-on Adblock Plus includes a useful new feature that is perfect for preventing your own visits to your website from appearing in Google Analytics.

If you use Analytics on your website(s) — particularly on very small sites such as this one, where your own visits can significantly skew any traffic measurements — you have probably wished you could reliably exclude your internal page views from your traffic reports. Google provides a filter system, but it falls a bit short if you aren’t visiting from a static IP address.

Aa great solution has just arrived in the form of Adblock Plus version 1.0.1, which finally provides the ability to restrict the domains to which its ad-blocking rules apply.

After installing the Adblock Plus extension, add a filter rule of the syntax

google-analytics.com$domain=zoombody.com

(replacing zoombody.com with your own domain). Now, when you visit your own site, you will remain completely hidden from Google Analytics.

You could undoubtedly apply this to other hit counters; Analytics just happens to be the service I use.

Comment on this article »



 

Run a Windows (”DOS”) batch/cmd script minimized

Here’s a snippet of code I wrote that will force a Windows batch script to run in a minimized window. Insert it at the beginning of the script:

if not "%minimized%"=="" goto :minimized
set minimized=true
start /min cmd /C "%~dpnx0"
goto :EOF
:minimized
rem Anything after here will run in a minimized window

It works by having the script re-launch itself in a new minimized window. There are a few juicy batch scripting tricks in here that I recently picked up, like the %~dpnx0 syntax and the special :EOF label. And the overall flag/callback syntax is generally useful for creating self-contained batch scripts.

Other start switches besides /min can provide different parameters for the child window, such as adjusting the CPU priority of the resulting process.

Comment on this article »