New Github repo: URLParams

I spent more time than I’d have liked last week fixing an issue related to the intermittently incorrect appending of UTM parameters to URLs. Basically, the code worked fine if the link was “basic”, but if it already had  parameters, a second question mark would get added. Since URLs cannot have two question marks, the link would break.

Adding parameters to links sounds simple, until you “roll your own code” and discover issues like– making sure your parameters are URL encoded, and checking to see if the link already has parameters, etc. I decided to capture these hard-won lessons in a JavaScript class called URLParam, and it’s freely available at GitHub.  (It’s worth mentioning– although ES6 classes enjoy wide support across Chrome, Firefox, Edge, Safari, etc., they are not supported in any version of Internet Explorer.)

I hope you’ll find this useful– both in the sense of finishing a coding task faster, and having fewer issues to resolve after deployment.

Fixed Width Text File Toolkit Update

GitHub contributions snapshot

Just a quick note to let you know I’ve made a minor update to my “Fixed Width Text File Toolkit” repo on GitHub.

If someone combined a bunch of fixed width text files (e.g. jan2010.txt, feb2010.txt, etc.) together into one big file (e.g. 2010.txt), that big file would have a series of header rows repeating throughout the data.  Granted, it’s an edge case, but it isn’t completely impossible.

This update makes the FWTF Toolkit “smart enough” to recognize a header row when it is repeated in the middle of the data, and ignore it automatically behind the scenes.  No configuration required, and it has surprisingly little impact on peformance.