Category Archives: Code
This Apache setting breaks mod_rewrite
I have had this problem on two very different grades of Apache servers now (cheap, shared stuff and a high-end, expensive, HIPAA-compliant box), so I thought I’d post something reasonably search-friendly in case someone else was looking for the answer. … Continue reading
VCALENDAR file with newlines in DESCRIPTION field
Hopefully if anyone else has this problem, they’ll find this post. If you’re attempting to output some data in a MySQL database as a VCALENDAR file that is viewable in Apple Calendar or Outlook or whatever, an incorrect newline character … Continue reading
MySQL Transactions
MySQL has the ability to handle what are known as transactions: a series of queries that must be executed in an all-or-none fashion. As a bonus, it’s super easy to use. Using PHP, you can do the following: mysql_query(“START TRANSACTION”); … Continue reading
Use PHP to get all images in a folder
This: $images = glob($directory . “*.{jpg,gif,png}”, GLOB_BRACE); is awesome.
iOS Training: Day 2
This is going to be a short one. After spending a ton of time at a computer the last couple days, writing a blog post isn’t the thing I’m dying to do at the moment. [Ed: Nevermind. Got rolling and … Continue reading
iOS Training: Day 1
Today was the first real day of class. Over the course of about 12 hours working, I went through the first six chapters of the book we are supposed to make it all the way through this week. Today’s chapters … Continue reading
iOS Training: Day 0
I left home in Indianapolis at 1:30 this afternoon and hopped a flight to Atlanta. After that, I took a one hour ride to Historic Banning Mills, Georgia, home of the Big Nerd Ranch. I got checked into my cozy … Continue reading
Conflagration of IE6, PHP session_start, and blank pages
Yesterday, I was troubleshooting a problem that (only) showed up in IE6 where anytime I click a link that goes to a page with session_start() in it, I get a blank page with no errors and the address bar shows … Continue reading
Select the last n rows from a MySQL table
I needed to figure out how to select the last four rows of a database table without reversing the order of the rows. After a little digging, I got to this point: SELECT * FROM ( SELECT * FROM table_name … Continue reading