1/7/2009 ~ 2 min read

DIY Mochas


Make a home-made Mocha: 1) brew some yummy costa rican coffee 2) in coffee cup add some coffee mate + two spoonfulls of cocoa 3) pour in an equal amount of hot coffee 4) stir until cocoa substrate is all in solution 5) fill cup with the rest of your coffee 6) enjoy! In other news I came across some very useful code for dealing with dates in php: strtotime() is a php function that takes a wide range of text inputs and returns a unix timestamp. For example I needed to take a date in the format of 2009-03-19 and check to see if its in the range of now-11 months and now+8 months. Thank you strtotime():

//create a date range object (now-11 months to now+8 months) and check to see if users due date is in the acceptible range $range[‘start’] = strtotime(“-11 months”); //now - 11 months $range[‘end’] = strtotime(“+8 months”); //now + 8 months $range[‘due_date’] = strtotime($yyyy . ’/’ . $mm . ’/’ . $dd); if( ($range[‘start’] < $range[‘due_date’]) && ($range[‘due_date’] < $range[‘end’]) ) { debug(“due date is within the range”); return true; } else { $_REQUEST[‘q21845’] = “Due Date Note Valid”; debug(“due date is not within the range”); return true; }


Headshot of Matthew Hippely

Hi, I’m Matthew. I live in Ventura County, and spend my time thinking about systems, software, and how things evolve over time.

You can find me on GitHub, LinkedIn, or read more about me here.