How to calculate Mother's Day and Father's Day with PHP

By Josh Sherman
1 min read
development
php

A little late on the Mother’s Day part, but since today is Father’s Day, I figured it would be fun to discuss how to obtain the dates for these moving holidays. To do so, all we need to use is use strtotime and tell it when the holiday will occur […]

The receiving end of a DDoS Attack

By Josh Sherman
3 min read
development
hosting
hivelocity

This post was supposed to be a discussion of my migration back to Android from iOS but direction changed yesterday morning. At 9:30 am I found myself in the middle of a DDoS attack that was affecting the rack my server lives on. My sites slowed to a crawl and […]

How to pipeline with phpredis

By Josh Sherman
3 min read
development
php
redis

Have you ever run into a scenario where you have to loop through a set of data and perform database queries for each iteration? Obviously we shouldn’t run them one by one, so we end up using a TRANSACTION or even just building out one large query in the case […]

How to process PUT requests with PHP

By Josh Sherman
1 min read
development
php

You are probably already familiar with $_GET, $_POST and $_REQUEST but what about $_PUT? Trick question, $_PUT (as well as as $_HEAD and $_DELETE) doesn’t exist in PHP at this time. Never fear! We can create a $_PUT array with the following code: if ($_SERVER['REQUEST_METHOD'] == 'PUT') { parse_str(file_get_contents("php://input"), $_PUT); […]

Breaking away from the Apple Ecosystem

By Josh Sherman
8 min read
apple
os x
ios

I’ve recently come to a crossroad with Apple and it’s ecosystem. I’ve had an iPhone 4S for the last 2 years and I was itching for a new device. Giving the current iPhone lifecycle, it makes more sense to hold out for the next iteration of the iPhone than jump […]