How to Override IE’s Compatibility View Behavior On Intranet Sites

To force IE to edge mode (even on intranet sites, where IE would otherwise use compatibility mode), the server needs to send X-UA-Compatible as an HTTP header. Using a meta element in the document head doesn’t work reliably.

I found the answer buried in this Stack Overflow thread.

In my case, I was working on a WordPress theme, so I added

header("X-UA-Compatible: IE=Edge");

at the top of header.php.

You can also do it at the web server level with Apache or IIS (I haven’t tested either of those methods).

UPDATE 3/13/2014: I have now verified the IIS method linked above.

Generating a Range of Dates in MySQL

Working on a report from a MySQL database, I needed a table of all dates for the next year. With SQL Server (2005 and later) there’s a CTE/recursive method to do this pretty elegantly, but I couldn’t find anything similar for MySQL. All the solutions I found involved temporary tables, loops, and/or stored procedures–none of these were viable options for me because it’s a production database and I can’t just go changing things. I needed a simple query, and since I couldn’t find one, I made one.

It’s ugly, but it did the job. Continue reading “Generating a Range of Dates in MySQL”