Just say no to cheap toner!

Posted by & filed under Computers & Internet.

Several months ago I came across a deal on toner that I just couldn’t pass up.  At $95 for each color cartridge, it was costing almost $400 to replace a full set of toner for my HP 2605, so the idea of spending $75 a piece instead seemed like a good one. Not so much…. Read more »

How to change the MySQL password in MAMP

Posted by & filed under Computers & Internet.

Reinstalled MAMP last week because the version I was using didn’t have PHP 5.3 which I needed for a project I’m working on. Had to do some Googling to find the default password for MySQL and how to change. First, the default username is root and password is also root. To update to a password… Read more »

Trimming all members of an array in PHP

Posted by & filed under Programming.

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 without having to do a separate function. Love those one line and done techniques.

JayCut – Online video editor

Posted by & filed under Computers & Internet.

Haven’t had a chance to play around with it much, but JayCut.com looks pretty slick. It’s an online video editor written in Flash so you can do your editing without leaving your browser. Probably not great for the 20 gigs of HD video from your daughter’s birthday, but for quick videos it might be worth… Read more »

htaccess to deny access, except for includes

Posted by & filed under Programming.

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 included file doesn’t match $_SERVER[‘REQUEST_URI’]. Sure, either of those work. But I came across a… Read more »

Dynamically link to CSS with JavaScript

Posted by & filed under Internet, Programming.

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 found worked in both.  So I hacked together a function of my own.  Should have… Read more »

phpMailer – Could not instantiate mail function

Posted by & filed under Programming.

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 unlikely that it was the host. So I took the phpMailer class and uploaded it… Read more »

bit.ly and PHP

Posted by & filed under Programming.

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 URL to shorten and returns a nice, short bit.ly link. Link: http://davidwalsh.name/bitly-php Just put the… Read more »

Missing httpd.conf in WHM / cPanel

Posted by & filed under Internet.

Came across an error after mistakenly clicking a link in my hosting control panel. At the time, WHM was working but none of the sites on the server would load. Trying to restart httpd manually from PuTTY resulted in an error that httpd.conf couldn’t be found. Fortunately, there was an easy fix. It’s a script… Read more »