Categories

Tags

Page 19 of All Articles

PHP without fancy braces

PHP is a C-style language and thus uses fancy braces to wrap or hug control structures. PHP is also a language that is extremely flexible so you can also get by without using fancy braces. You will never get away from them entirely as functions and classes / class methods […]

Tools of the Trade - 2014

It was February 18th, 2011, a week before my 30th birthday that my answers to AppSumo’s Tools of the Trade questionnaire were posted. A metric shit ton has changed since then - new jobs, new hardware, new software. At the same time, some things never change. This post is the […]

Debugging SimpleXML Objects with PHP

SimpleXML is pretty much the de facto standard for dealing with XML in PHP. The biggest problem with SimpleXML is that it is a pseudo-object that you can’t print_r() or var_dump() to see what’s going on. I recently ran into a situation where it would have been super nice to […]

Self-employed cabin fever

I was somewhat skeptical that it would happen to me, be after over a year of working for myself and by myself, it finally started to take it’s toll. I had an office so that I would have a place to go during the day to feel like I was […]

Parsing SOAP responses with PHP's SimpleXML

We recently discussed parsing XML with SimpleXML and since that writing I ran into a situation where I needed to parse a SOAP response. As it turns out, SOAP responses are a totally different beast when it comes to parsing them with SimpleXML. SOAP responses contain namespaces on some if […]

Quitting a job you just started

It’s happened to everyone, you just started a brand new job, probably event left a decent job for it, only to realize that the new job sucks and you absolutely hate it. It happened to me recently, I was starting to get cabin fever working for myself and decided to […]

How to calculate Independence Day observances with PHP

On this 238th anniversary of the United States of America, I felt it appropriate to post an article on how to determine what day the July 4th National Holiday is observed on. There are two rules to the observances. First, if the holiday falls on a Saturday, it is observed […]

The importance of a staging environment

Full disclosure, I don’t actually have a staging server for my personal projects. I develop locally in a very similar environment as my production server and any time I have to do something major, like upgrading the OS or upgrading software between major revisions, I always do a dry run […]

How to parse XML with PHP's SimpleXML

Parsing XML in PHP couldn’t be easier thanks to the SimpleXML extension. SimpleXML allows you to read in an XML string, verify that it is in fact XML and can create an object that you can interact with by way of the node names in the XML.The SimpleXML extension also […]

$10 Showdown: Linode vs. DigitalOcean

Every time I think that I’m done with this topic for a while, someone (usually Linode) drops something new on us. The latest from Linode is the addition of a 10$ a month plan which nearly puts it in line with DigitalOcean in regard to low tier pricing. Because of […]

Checking your IMAP email using PHP

I have an upcoming freelance project coming up that includes checking an IMAP email account as well as working with XML in PHP. Let’s talk about connecting to an IMAP account in PHP, don’t worry, I’ll discuss parsing XML next week ;) For the sake of example, we’re going to […]

Android Pros and Cons after 2 years with an iPhone

I recently discussed migrating to cross-platform apps in an attempt to break away from the Apple Ecosystem which was a precursor to me swapping my iPhone 4S for a Nexus 5. Now it’s time to talk about the pros and cons that I ran into by making the move. PRO: […]

How to calculate Mother's Day and Father's Day with 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

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

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

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

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 […]

URL Routing with PHP

I’ve been taking a lot of programming tests / challenges recently as I was in the market for a new [and hopefully exciting] opportunity to spend my time on. Because of this, I am full of new blog post ideas based on the questions / challenges asked. This week I’m […]

Having a child ruins your life

I started a new contract gig this week and one of my new co-workers was very candid in letting me know that having children ruins your life and implying that I in fact had ruined my life in doing so. To be quite honest, I was very taken back by […]

Spending money on advertising only to acquire spammers

I performed a little experiment last year, I decided to spend a small bit of money on advertising one of my sites via AdWords. My budget was low as I didn’t want to spend more than 100$ and my daily allocation fluctuated between 1$ and 5$ as I made adjustments […]

Google Places PHP Library

I tend to shy away from these self gratifying posts about my own open source contributions, but I’m going to make the exception because this particularly library has been receiving quote a few downloads this month. I’m unsure for the increase, but my Google Places PHP Library has had over […]

Linode vs. Digital Ocean, performance benchmarks

I mentioned the in my last Linode vs. Digital Ocean post that I would be doing a performance comparison of the two in the near future and here it is! I used sysbench with some pretty basic settings to compare a 2GB server from both hosting companies. Apples to apples, […]

How to Install PHP Redis on Ubuntu 14.04 LTS

Previously, I had shown you how to install PHP Redis from source but things changed with the latest Ubuntu LTS release. Now you can install the phpredis extension from the Ubuntu respositories. First, if you don’t have it installed already, let’s install Redis: sudo apt-get install redis-server After we get […]

Swallow your pride and stop blaming your tools

I was at my favorite neighborhood biergarten last week when I spied a flyer on the bar for the today’s Cinco de Mayo event. Upon closer examination, I noticed that the kerning was set very high in between the Ma and the Yo so it looked like Cinco de Ma […]

How to Install the MongoDB PHP Module on Ubuntu 14.04 LTS

Installing the PHP module for MongoDB on Ubuntu 14.04 LTS is just a command away, but first, let’s ensure that we have MongoDB itself installed: sudo apt-get install mongodb Once we have MongoDB installed, we can proceed with installing the module. Please note that you could combine these commands to […]