Month: June 2013

  • PHP TIP: A quick, non-RegEx way of replacing an IMG tag’s SRC= attribute

    It’s often useful to be able to swap out the src= attribute of an HTML IMG tag without losing any of the other attributes. Here’s a quick, non-regex way of doing this. It uses the PHP DOM API to create a tiny HTML document, then saves the XML for just the IMG element. function replace_img_src($original_img_tag, […]

  • TIP: How to Play a Sound Whenever You Commit to Git

    Writing code alone at home can be an isolating experience. There you are, day in day out, quietly making magic with your mind (sarcasm, obv.) only to silently commit the fruits of your labor into the void of your source control repository, appreciated by no one. If only a crowd of children could be retained […]