Andrew Heins

default-image

Blog Posts

2 Posts found from May 2011


Code Snippet of the Day: appendToFileName

I find myself having to append file names often in JavaScript.  var appendToFileName = function(filename, toAppend) { var x = filename.lastIndexOf(‘.’), before, after, newFileName; before = filename.substring(0, x); after = filename.substring(x, filename.length); newFileName = before + toAppend + after; return newFileName; }; Anyone know why substring in JavaScript isn’t subString? That gets me every single [...]


Jumping Through the Hoops

Applies to Learning, Coding, Writing, Sports and just about anything else worth doing… I’ve spent the past week learning about Unit Tests and TDD. It’s a frustrating process that shows a lot of holes in your code and your development methodolgy, but from what I’ve seen so far, I get better code from it. I’ve [...]