Blog
Get all defined variables in PHP
I've never actually used this function, but could definitely see using it to help profile a system and/or to help identify defined but unused variables. To obtain an array of all of the defined variables you would: $defined = get_defined_vars() [...]
Working with JSON in PHP
JSON is one of my favorite human readable formats. It's widely used and has great support in PHP as well as other languages. PHP allows you to easily convert variables into JSON and JSON into objects or arrays. First, let's [...]
Handling click and touch events on the same element
I'm starting to feel behind the curve. I started receiving feedback that some clickable elements on my social networks were not working on touch devices. Without much thought, I went ahead and added touchstart along side of click to bind [...]
Truncate string with ellipses with PHP
We previously discussed how to calculate the length of a string in PHP and I made mention that using that function is how you would go about truncating a string if it's over a specific length. I also said that [...]
Staying motivated with streaks
I'm having one of those weeks where I zero motivation to sit down and write a blog post. Spent part of the week in Austin with the work fam. Haven't even unpacked yet. Still getting back into the swing of [...]
Get date for Easter in PHP
All the good things about Easter aside, it's one of those holidays that's a pain to get the date for. This is because the date of Easter is based on the lunar cycle and Spring Equinox (March 21st). The date [...]
Chat Personas
Going to make this brief since it's Easter and I forgot to blog ahead of time this week. So I've recently been hanging out on a few Slack teams. One with the work crew, one with my small group of [...]
Serializing and unserializing variables in PHP
Serialization in PHP is the act of converting a variable into a storable value. When I say storable, I mean being able to store the result in say, a database or a flat file. This is commonly applied to arrays [...]
Decouple your code from your web server
I used to be quite adamant about running nearly the same exact software stack locally as I did on my servers. Running Linux made it easy to pull this off and being able to do the same on OS X [...]
Start your day with a list
I've been seeing these "how productive people start their day" posts on my social feeds a lot more recently. It got me thinking, "hey, I consider myself successful, how do I start my day?" A while back I started to [...]