Analytics

Debugging Adobe Analytics

Posted on

Adobe Analytics can sometimes be a bit of an enigma, so people often turn to browser extensions to help them with debugging Adobe Analytics. However, for those of us who spend most of our lives in browser tools; there’s a simple way to get x-ray vision into what Analytics is thinking. Let’s get straight down […]

Programming

Simplify Strings for Comparison by Removing Special Characters and Diacritic Marks

Posted on

I was working on a search system that needed to simplify the strings for comparison. It needed to compare the text regardless of special characters (diacritic marks) or casing. The following function breaks the special characters into their component parts, before removing the “special” parts and lower-casing the whole thing. function normalise(term) { // Simplifies […]

Programming

Find All Images on a Page With JavaScript

Posted on

One of the most common issues I see in content-managed websites is the presence of a fully-qualified image address that isn’t secure when the website itself is. When this happens, you’ll need to find all images that aren’t secure and fix them. For example, if you are visiting https://www.example.com and there is an image http://www.example.com/image.png […]

Programming

Minification Failed. Returning Unminified Contents.

Posted on

Has you ASP.NET applicaiton reported that minification failed? If you are using bundles in application, you might come across this exception comment at the top of your larger-than-expected bundle file. /* Minification failed. Returning unminified contents. (List of problems here) */ It can happen for JavaScript or CSS, but it means minifier has found something […]

Programming

Using a Proxy to Intercept Methods

Posted on

This is just a short note on how to use an ECMAScript Proxy to intercept methods. There are plenty of examples that intercept properties, but examples with methods seem absent currently. For demonstration purposes, we’re going to intercept a very famous method. The console log method takes any number of arguments of any type. This […]

Programming

TypeScript Optional Chaining Interim Method

Posted on

ECMAScript has an optional chaining proposal on the way (see TC39 on GitHub). It uses ?. to chain together an expression in a way that forgives a breaking chain. For example, myObj.items[0].data can fail if myObj is null, or undefined, or doesn’t have an items member, or there are no entries in the items collection, […]