Converting column number Excel column name

Posted by & filed under Programming.

Quick little snippet needed while working on a web app that exports to an Excel worksheet. What I needed was a way to convert column numbers to the lettering that Excel uses. So, for example, column 27 would become AA. Found a bulk of the solution at Stack Overflow. Logic wasn’t exactly what I was… Read more »

Regex to replace multiple spaces

Posted by & filed under Programming.

Normally I just don’t worry about this since I’m usually building websites and HTML takes care of merging multiple spaces. But it comes up occasionally. And since it’s just a quick regex replace, it’s pretty quick to merge multiple spaces. Piece of cake. It looks for any places that there is 2 or more spaces and… Read more »

Should add new comment be above existing comments

Posted by & filed under WordPress.

Had a thought while scrolling to the bottom of a WordPress post with 250+ comments. Does having the add new comment form at the bottom of a page that long lead to fewer comments? Really, who is going to scroll that far? So I’m going to play around a bit here and move the comments… Read more »

PHP, __FILE__, and eval()

Posted by & filed under Programming.

Came across an odd error last week. And by odd, I mean that Googling for the error message only turned up one page. One of my scripts was using eval as a way to semi-protect the code. Yeah, not a great solution. But it’s not possible to install software on all of the users’ servers… Read more »

Sorting on version numbers with PHP

Posted by & filed under Programming.

Needed a quick way to sort on version numbers, and PHP has a usort function that makes it pretty easy. You’ll need an array to sort and call the usort function with a callback. Now the callback. We’re going to use version_compare. Only minor quirk is the * -1 to flip version compare. I wanted… Read more »

Amazon Images plugin for WordPress

Posted by & filed under Blogging, Programming.

Every now and then I like to link to Amazon products, along with an affiliate tag. Nothing spammy. But I figure if I’m going to link to something that they make money off of, I might as well try to make a bit as well, right? Downside is that the link builder inside Amazon typically… Read more »

Count all post in a WordPress blog network

Posted by & filed under Blogging, Programming.

Needed this bit of code to keep count of the total number of posts in a network enabled WordPress site. It pulls the list of blogs and the goes through each, gets the post count, and sums it up. Certainly not real efficient, and doubtful you’d want it to run often on a large network…. Read more »

Comparing two SVN branches – thank you TortoiseSVN

Posted by & filed under Programming.

Updating the available pre-release version of ProofBuddy was on my to do list last weekend. A few months ago I wrote a script that pulls a specified version from a subversion tag and packages it up. For the last couple of weeks I’ve been sitting on a beta version to give testers a chance to… Read more »