You can find it here on GitHub
You just have to include the script below your CSS and it handles it all for you. Very handy.
I have a table like this:
This query will figure out which time range the current time fits in. In this case, it figures out if we’re in breakfast-zone or lunch-land.
IF(CURTIME() BETWEEN starttime AND endtime,1,0) AS active
If you’re not used to using BETWEEN, here’s a way using the > and < operators.
IF(CURTIME() >= starttime AND CURTIME() <= endtime,1,0) AS active
This makes a seperate field called active and sets it to 1 if the meal is within the current time, otherwise it’s 0.
I use a Mac primarily for development. Mostly because I got pulled into making an iOS app (and Apple won’t let you develop on any other platforms than theirs for that, of course), but I really started liking it for other reasons than most people would say. I don’t really care about the design or the “apps”, but I actually really love the Terminal (or more specifically iTerm2). The Windows command line just feels… second thought. It’s not really a part of the operating system the way a UNIX terminal is. Now I could say the same thing about pretty much any Linux distro, and if the Adobe suite could run on Linux, I’d switch in a heartbeat. But for now, I’m sort of stuck with OSX, and I’m okay with that for now.
So anyways, when I do need to run Windows for IE testing, a lot of people recommend Parallels because “it’s the easiest” or “it’s the most Mac like” or whatever. But for me, I really don’t give a shit about any of that, especially if I’m forking over $50+ just to run Windows for one purpose. I don’t care about any other features except for Internet Explorer.
I run VirtualBox, a free open-source virtualization program for pretty much any OS. I can load an ISO of a Windows 7 install disk (or physically put the disk in), and it installs on a virtual drive and does EXACTLY what I need it to do, without throwing away money at something like Parallels. I can specify how much RAM it uses, USB support, shared folders with the host (awesome), and a shit load of other features. You can even output the OS on remote display!
This is by far the easiest/cheapest way to run IE on a Mac, especially when you can run things like IETester or IE10, which pretty much covers all of IE IMO. You could also install the IE Collection but it might be a bit overkill for most users.
This can be handy to create some previous/next links for different page entries.
SELECT * FROM foo WHERE id = (SELECT MAX(id) FROM foo WHERE id < '.$id.')
SELECT * FROM foo WHERE id = (SELECT MIN(id) FROM foo WHERE id > '.$id.')
I’ve been using Linode for just under a year for this site and a few others (and for just messing around with different languages) and my experience with them has been amazing. They offered everything I needed from the get go and their support ticket system almost always replied back to me within a couple minutes.
I highly recommend them to anyone looking for a VPS system. You can check them out here.
If anyone has any questions about Linode, leave a comment and I’ll get back to you ASAP.