PHP Portable Paths

Frankly, I don’t care about people wanting to run my code on a Windows box and it not working. But in reality, for some reason, there are people who write code using computers running the Microsoft Windows operating system. Why don’t they use a Mac, or if they don’t have or want to spend the

How to Configure Apple Airport Extreme and Verizon Fios Router

I prefer Apple products over pretty much any other computer product any day of the week – if I can afford it. Prior to getting Verizon Fios, my preferred wifi router was my Apple Airport Extreme. What I like about the Airport Extreme is that I can plug a hard drive into it and do

Connect Existing Eclipse Project to a Git Repository

Since we moved to Git at work for version control, I’ve had a few occasions in which I had an existing Eclipse project in my IDE that I wanted to connect with a Git repository. The process is, I feel a bit convoluted, but it sort of made sense after I did it once. First,

PHP Monolog Choking on Large Log Entries

I’m using Monolog to log XML coming into a SOAP service and some of the XML is really long. I’m using a LineLogParser and it’s calling preg_match to parse each line of the log. Well on the big XML files, preg_match was hitting a “backtrack” limit. What I had to do was crank up the

Linux Find Directories Consuming The Most Data

If you want to find out which directories on your Linux box that is gobbling up all of your disk space, use this command. du -h <dir> | grep ‘[0-9\.]\+G’ If you want to check the current directory, don’t include a

SVN Resolving Conflicts

While I guess it’s showing its age, but subversion is still a pretty good source control tool. My problem with it is that I’m always confused about what to do when I get a conflict. This is probably because I only deal with this issue a few times a year. Here’s what I do when

Easiest Way to Customize a Symfony Form

Before I get started, I realize that Symfony has this entire form theming apparatus and it’s great. But this is a simple technique that puts the control of the form in the hands of the person laying out the HTML rather than the developer. All I do is when I’m rendering my form, I wrap

SVN Merge Changes From Branch into Trunk using Reintegration

If you’re like me, when using subversion, you have a trunk, and then you create branches for code fixes and enhancements. But if you’re like me, you already know how to do this and so reading this is a waste of your time. But if you’re REALLY like me, you don’t remember all of these

PHP Get the First of Next Month

While having fun with dates, I needed to get the timestamp for the first of the next month, here’s how I did it with PHP. strtotime(date(‘m’, strtotime(‘+1 month’)) . ‘/01/’ . date(‘Y’, strtotime(‘+1 month’))); I then used that to create a PHP DateTime object like this. $date = new DateTime(); $date->setTimestamp(strtotime(date(‘m’, strtotime(‘+1 month’)) . ‘/01/’