This is rather specific, but if you're implementing Handlebars (in PHP) using LightnCandy, here's a great helper that lets you compare values and generate output accordingly.
Here's another gotcha if you're using PHP's
basename() on a string that contains non-Latin characters: The resulting string will get butchered.
When I stumbled across this post today, I was almost convinced that I had wrote it myself. Many of the points in it hit home, so I hope it helps people better understand how developers think and what they go through when interruptions arise.
Ever wished you could vertically center your Bootstrap modals? Here's some code that will let you do just that.
Last week I started using spaces to indent code instead of tabs. It's something I swore I would never do, but I'm glad I finally did.
I needed to sort hundreds of lines of text in a PHP file the other day. It was a large array of strings, and I wanted to alphabetize it so I could easily see if a specific string was already present.
Here's a helpful tip for those who need a basic, three-line navigation menu icon. It's just a simple Unicode character.
I know you can change the mouse cursor using CSS, but I never realized that you can actually hide it altogether.
You probably know that you can use data URIs in just about any browser now, but how do you convert an image to a data URI? Turns out, most browsers can do it for you.
In a mere four hours of development, Johnny Lin turned an idea that was scribbled on his notepad into a web app that went viral almost instantly.
$.animate and performs even better than CSS animations.
We've been hearing about PHP 6 since 2005, but nothing has been brought to fruition yet. In fact, the project was so plagued with problems that in 2010, it was abandoned. It almost felt like PHP would be perpetually stuck at version 5.
The other day I was chatting with a friend about Meteor and Node.js. He wanted to show me some code, but in the past Skype's screen sharing hasn't worked so well for that. Then he told me about Screenhero.
A few years ago, I posted a couple functions for validating email addresses using PHP. This is a follow up post that provides a simpler method for validating both email addresses and URLs.
Gone are the days of arbitrarily assigning version numbers to every new software release. With semantic versioning, the question of how and when to bump versions is made simple.
I recently came across an issue where Coda and Transmit would just appear to hang when deleting files on my local machine. Fortunately, the good folks at Panic were able to identify the issue. Turns out, it's a OS X bug.
Scheduled tasks (or "cronjobs") are useful for executing scripts on your server at various intervals of time. They're fairly easy to setup in Plesk 11, which comes with Media Temple's Dedicated Virtual (DV) 4.0 systems. However, if you're using something like
curl in your task, it may not appear to work.
When working with CSS transitions, the need to detect whether or not the browser supports them may arise. It can be of particular use when working with the
transitionend event, which won't fire in unsupportive browsers.