First Time Here?

Welcome to Best Practices. I run a freelance web development business, and this is where I share what I've learned and the mistakes I've made along the way. Some of it applies specifically to web development, but a lot of it is just about hanging out my shingle and running a business. If you have any questions, fire away.

Window’s Host File Gives You Your Own Personal DNS Settings

So here’s a useful trick I was reminded of this past week.

Sometimes as a developer I write code that appears on multiple web sites. I just write a few lines that check what domain name the current site is using and execute the relevant code appropriately. Confusing? Think about when you sign up for an account at WordPress.com. You have a blog at yourusername.wordpress.com. Everyone’s different blogs are all pointing to the same code, but different database records are pulled based on the domain name being used.

The inconvenience here as a developer is when you need to test what you’ve written with a particular domain. You can update the DNS to point to your server, but if there’s a problem then the whole world is going to be looking at the broken site. You need to see it, though, so you can fix it.

Read the rest of this entry »

Mar 25th, 2009

Broken Apostrophes When Querying WordPress Tables

I’m a big fan of the WordPress blogging platform, and it’s the one I use when I’m setting my clients up with a blog. In most cases they want WordPress to be a small part of their site instead of the whole thing. (You can certainly make a case for WordPress as a full CMS, [...]

Mar 19th, 2009

Making Your CSS Files Dynamic With a Little PHP

I’ve grown so accustomed to writing in languages like PHP where I can use variables, loops, and arrays to cut down on the amount of duplicate code I need to create. I love the flexibility I had to make things as efficient and modular as possible. So I used to dread working with a CSS [...]

Mar 4th, 2009

Creating Laser-Like Focus With My Inbox

photo credit: urban_data I haven’t written anything in a while. The time constraints of being a new dad and starting on a new business venture are insane, so I think I’ve avoided starting because I don’t have time to do the long posts that I’ve historically done on this blog. Here I’m taking a stab [...]

Feb 10th, 2009

Best Practices Rewind: Change Requests

photo credit: Extra Ketchup Until just recently, I had gotten into the bad habit of using my inbox as the storage location for customer change requests. Until I completed all the items mentioned in an email from a client, I just left it in my inbox. (It’s especially tempting when the email has an attachment [...]

Jan 14th, 2009

Changes in 2009

This is the first post I’ve made in over two months. A crazy amount has happened in that time. I’ve become a new dad. This is picture of my new daughter, Libby Joss Mabbitt. She’s the one in the picture with lots of hair. This is a good time to revisit a post I wrote [...]

Best Practices

presented by Site Potion