Categories

Tags

Page 15 of All Articles

Start your day with morning pages

In an attempt to improve my writing capabilities, I have been trying to read and write more regularly. Since I don’t always have something to blog about and because I don’t want to stress myself out by trying to blog every day, I have been seeking alternative ways to stimulate […]

Knowing when to quit

A few months back I wrote a post about staying motivated by continuing streaks and how having streaks can keep you motivated even when you are struggling. Just the thought of breaking a streak, especially one that’s a few years old is terrifying. Right now, I am terrified. After two […]

Improving my Vim experience

I love Vim but the fact is I’ve been soul searching for a new editor because I am starting to think I am missing out on things. I decided to put together a list of issues that I have with Vim so that I can work towards imprioving my Vim […]

Detect bots and spammers with Project Honey Pot and PHP

Project Honey Pot is one of my favorite services. They offer an API that allows you to pull information on an IP address. This comes in very handy when vetting traffic coming to your website. I discovered the service a few years back after realizing that I had some spammers […]

How to convert a string to a time with PHP

Converting a string to a timestamp is one of my favorite things about PHP. In fact when trying to decide which language to build [HolidayAPI][holidayapi] in I couldn’t find an implementation of PHP’s strtotime() that rivaled the original. The strtotime() function takes a textual string as input and then spits […]

Cutting the cord on cable

IT HAPPENED, IT FINALLY HAPPENED! I have been fighting the good fight against my wife for a while now. Why are we paying for Netflix, Hulu, Amazon Prime and the occasional Redbox movie on top of paying for cable? NO MORE! We are now cable free and I couldn’t be […]

Set array pointer to a specific key or value in PHP

PHP arrays are absolutely fantastic. They hold stuff, doesn’t really matter what. The interfacing is pretty consistent and there’s a boat load of built-in array functions. What PHP lacks is the ability to set the array pointer to an arbitrary key or value. There are ways to move forward and […]

Safari bug when signing up for Twitter

Wasn’t entirely sure what I was going to blog about today when a stroke of inspiration occurred after the wife was strugglging to create a new Twitter account for an upcoming adventure. I tried it from her computer and everything seemed fine. She said it was because I type faster […]

The power of a morning routine

After some recent research I realized that people I consider successful are generally quite scheduled. Not necessarily through their entire day, but at the very least they have a morning routine that occupies the first 90 minutes of their day. I’m going through a bit of a personal growth spurt […]

Basic page routing in PHP

Last week we talked about setting up a local development server with PHP’s built-in web server and I mentioned that we’d delve into page routing. Routing refers to taking the URI that a person was requested, let’s say /about and routing that to the appropriate code. Sure, you could just […]

Using PHP's built-in web server

I recently updated [HolidayAPI][holidayapi] to no longer use my PHP framework because I wanted the system to be easier for new developers to get up and running. Instead of including configuration files for Apache or nginx, I decided that I should just use the web server that’s baked right into […]

My standing desk made me lazy

You may remember my previous post about my switching to a standing desk. I absolutely loved it. I felt inspired with the new perspective and genuinely felt better. It took a few weeks to get used to the new setup. Most of the initial hurdle was tired legs from years […]

Wonder what’s next?

I have been running this blog since 2013 as a way to improve my PHP as well as my writing. It has been a labor of love and I made it my goal to post at least once a week. At the start of 2015 I decided that I would […]

Outline numbering for an object tree

Last week I had talked about a layout dilemma that my buddy Justin was having. This reminded me of an issue that programming challenge he hit me with a few months prior. The challenge was to take an object tree and generate the proper outline numbering for it. The object […]

Layout with fixed header and independently scrolling columns

Update April 4th, 2019 Seems at some point between May of 2015 and now, the code in this post went terribly stale. It wasn’t working in either Firefox or Chrome and I’ve since updated the code with a working example. Many thanks to everybody that blew up my comments about […]

Working with Dynamic variable names a/k/a Variable variables in PHP

Variable variables are one of my favorite things about PHP. PHP allows you to use a variable to reference another variable. This comes in exceptionally handy when you need to create variable names dynamically: $variable = 'This is my variable'; $var = 'variable'; echo $$var; Let’s say you have you […]

Open Challenge: Learn Lisp with Me

Starting on May 1st, 2015, I am setting out to learn Lisp because I feel like I’m missing out by not knowing it. I see it come up pretty regularly, it’s stood the test of time and there are a plethora of dialects. I am going to target Common Lisp […]

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(); The function returns a multi-dimensional array of all of the […]

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 take a look at how we can convert an array […]

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 both events: $(document).on('click touchstart', '.feeny', function(e) { alert('Believe in yourselves. […]

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 down the road I would discuss the topic at hand, […]

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 being at home. In the middle of a major redesign […]

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 of Easter on a given year could fall between March […]

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 tech friends and a couple of “public” teams with local […]

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 and objects as they are not simply text strings. Under […]