Category Archives: Programming

Just finished up a couple of WordPress plugins

Needed a break from a larger web app I’m working on and this weekend kicked out a couple of WordPress plugins that I’ve had on my idea file for a while now. The first is called rTwit and lets you … Continue reading

Posted in Programming | Tagged , , , , , , , , , | Leave a comment

JavaScript version of PHP __FILE__ or __DIR__

This is one of those issues I keep coming back to.  I need a way to get the path of the current JavaScript file.  Something analogous to the PHP __DIR__ constant or dirname(__FILE__). Found something close on Stack Overflow.  The … Continue reading

Posted in Programming | Tagged , , | 2 Comments

Trimming all members of an array in PHP

Needed a quick way to go through and trim leading and trailing spaces off of a string array in PHP. I’ve used array_walk to do it before, but with the addition of anonymous functions it makes it a little quicker … Continue reading

Posted in Programming | Tagged | Leave a comment

htaccess to deny access, except for includes

It’s usually a bad idea to allow php include files to be directly accessed. My general method is to either declare a constant in the index.php and check for that constant in the included file or make sure that the … Continue reading

Posted in Programming | Tagged , | 2 Comments

Dynamically link to CSS with JavaScript

Needed a way to add a CSS file with JavaScript, so I went out a-Googling like I normally do.  Problem is everything I found either worked in Internet Explorer and not in FireFox or the other way around.  Nothing I … Continue reading

Posted in Internet, Programming | Tagged , | Leave a comment

phpMailer – Could not instantiate mail function

Had a client getting this error when trying to send emails last week and have now spent several hours on Google trying to find a solution. Biggest catch is that other scripts were able to send mail, so it seemed … Continue reading

Posted in Programming | Tagged , | Leave a comment

bit.ly and PHP

Needed a quick and easy way to create a bit.ly URL for another site of mine. Google came through for me. David Walsh posted a short PHP function on his site that takes your bit.ly login, API key, and the … Continue reading

Posted in Programming | Tagged , , , , | 1 Comment

Quick PHP wrapper for print_r

Working on web apps I find myself using the print_r command a lot, and I mean a lot. It helps trace out what data is going where, and more often what’s not going where it’s supposed to. A few months … Continue reading

Posted in Programming | Tagged | 1 Comment

Safari, scriptaculous, and non-clickable links

For the better part of the last couple of days I’ve been trying to figure out why Safari was not allowing me to click on links. Aside from an annoyance, it’s not good to have clients complaining…

Posted in Programming | Tagged , , , , , , , | Leave a comment

Prototype.js, setStyle, and IE not working together

Sometimes IE just irritates me. Ok, pretty much anytime I’m working on a web site. Especially when it involves Javascript or DOM. For the past couple of hours I’ve been scouring the internet looking for a solution to the prototype … Continue reading

Posted in Programming | Tagged , , , | 2 Comments