Quick Tips Tutorials
git tag
git tag
is used to pin down a given revision as significant, often for the purpose of officially releasing code. Once a tag is created, it's often referred to by build and deploy scripts instead of the tag's represented commit. Tagging revisions and deleting tags in git is easy...Array.From
In the past we used a variety of hacks to convert Array-like objects (like
arguments
andNodeList
) to a true array. You can see a few of those hacks here: Convert arguments to Array Convert NodeList to Array Essentially we would useArray.prototype.slice.call()
on thearguments
orNodeList
to do the conversion. These days...Add META Tags to WordPress Head
The reason that WordPress is so developer-friendly is their awesome hook system. Depending on a post category (or seemingly anything else), you can modify the contents of the page, the theme templates, and everything else. WordPress is amazing. One recent use case I had was wanting to modify...
Get a Single Header with cURL
Debugging third party apps can be difficult for a variety of reasons. You take for granted that the third party has not only properly coded their app but that their server is also serving files properly. As more a developer than a sysadmin I tend to spend a long...
Get Array Values Recursively with PHP
I've been helping to write a WordPress plugin (I'm not ready to share it yet) and one of the tasks required is validating an array of user-selected values against a list of known valid values. The known valid array is actually a
key=>value
array so unfortunatelyarray_values
wont help get...Extend Native Prototypes in Node.js
As someone who was on the legendary MooTools JavaScript team, I have some affection for extending the prototypes of native objects. Of course the practice of extending prototypes is taboo these days as browser vendors are iterating and implementing new specs more quickly than the IE6 era, but extending natives in Node.js...
301 Redirect with Express
If you've created a site using Node.js, there's a great chance you've used the Express framework. Express has turned into a massive project and for good reason: it's loaded with useful functionality, an easy API, and massive community support. On of my recent projects was...
Convert Image to ASCII Art with Node.js
There are many people out there that don't appreciate ASCII art; we call those people "idiots". ASCII art has been used forever and remains, in my opinion, a feat of programming and creativity. There's a project called image-to-ascii which doesn't just create ascii art but does so from...
Get Redirect URL with cURL
URL redirects can be glorious or annoying depending on which side of them you are on and which side you want to be on. Redirects are helpful for vanity URLs (useful in advertising) but sometimes they're annoying in that they could potentially break your code if you...
Show Images in Console with Node.js console-png
Introducing colors into the command line makes console reading much easier which is why finding Chalk was a life-changing event for me. I started digging deeper into making the console more graphical and I found another module that could bring the console to life: console-png! The JavaScript Assuming...