Simplifying Single Server Deployments

By Josh Sherman
6 min read
development
bash
command-line

Last week I discussed the importance of version control for individuals but something I didn’t touch on was how version control systems can be used to simplify and/or automate deployments. I’ve been through the different setups out there, using plain old rsync, leveraging GitHub’s Post-Receive WebHook to call a URL […]

How to Strip Whitespace from a String with PHP

By Josh Sherman
1 min read
development
php

Whitespace, it can make all the difference in the world when attempting to determine if a string is empty or not. Anytime you are working with user input I recommend stripping whitespace from both sides of the string. When stripping whitespace you can choose to strip from both sides or […]

How to Increment / Decrement a Number with PHP

By Josh Sherman
1 min read
development
php

Incrementing and decrementing a variable can be accomplished with C-style pre- and post-operators. The pre-operators return the value after it as been incremented or decremented, post- return the value before. Let’s take a look at incrementing first: $i = 1; echo ++$i; // outputs 2 echo $i++; // also outputs […]

While you were out - `while` loops in PHP

By Josh Sherman
1 min read
development
php

while loops are considered the simplest type of loop in PHP-dom. Their purpose is to continue to execute until a condition has been met. Let’s look at an example related to the title, a pseudo-script that will collect messages while you’re out, returning at 1pm (like a lunch break ;): […]

Version Control for Individuals

By Josh Sherman
4 min read
development
version control system
github
gitlab

I find with a lot of folks I interact with, version control is considered something that you use when you are working on a team with multiple contributors. As an individual that is usually the sole contributor of my own projects, I have to disagree as version control is still […]