Debugging Adobe Analytics

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 downContinue reading “Debugging Adobe Analytics”

Fixing CSS object-fit for Internet Explorer

A common problem with images, especially if they are user-generated, is that they don’t have the correct aspect ratio for their intended purpose. Also, as we re-flow pages for many different devices, we often want the image to work with different aspect ratios. This is where the CSS object-fit property comes in very useful. ThereContinue reading “Fixing CSS object-fit for Internet Explorer”

HTML Loading Attribute for Lazy Loading Images and Iframes

If you have been writing websites or web apps for any length of time, you will almost certainly have implemented some form of lazy-loading using JavaScript. I recently worked on a web app that implemented a search that benefitted to the tune of half-a-gig by deferring the loading of images until those images were actuallyContinue reading “HTML Loading Attribute for Lazy Loading Images and Iframes”

Simplify Strings for Comparison by Removing Special Characters and Diacritic Marks

This is the JavaScript edition, but I also have a C# method to remove special characters diacritic marks. 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 intoContinue reading “Simplify Strings for Comparison by Removing Special Characters and Diacritic Marks”

Code Responsibly: Paying Attention to the Humans You Impact

One of the consitent truths I have found in every development team I have worked with is that there is more work that can possibly be done. A great deal more. For the forseeable future, this will always be the case. I can come up with an innovative new idea by chance one Sunday afternoon.Continue reading “Code Responsibly: Paying Attention to the Humans You Impact”

Expecting One Out Of Two Members in TypeScript Types

We’re going to use a simple restaurant set-menu example to explore TypeScript types. By the end of this thought-process, we’re going to be able to require one out of two members that are present on a type. Here’s the scenario. You have a set three-course menu. It looks like this: type SetMenu = { starter:Continue reading “Expecting One Out Of Two Members in TypeScript Types”

Find All Images on a Page With JavaScript

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 and there is an image reading “Find All Images on a Page With JavaScript”

Prevent AJAX Requests Making Sessions Infinite in ASP.NET MVC

If you are terminating inactive sessions in your ASP.NET MVC application and you add an AJAX polling call, the chances are you’ll make your sessions last forever thanks to the AJAX request bringing down an updated session cookie. This is because the AJAX call will pull down an updated auth cookie and extend your timeout.Continue reading “Prevent AJAX Requests Making Sessions Infinite in ASP.NET MVC”

Html.RenderAction Equivalent in .NET Core MVC

If you were a fan of ASP.NET MVC Widgets using Html.RenderAction, you might be a bit stunned that RenderAction is nowhere to be found in .NET Core. Don’t worry, though, because there is a Html.RenderAction equivalent in .NET Core MVC and it’s called View Components. View Component Class The view component class is quite aContinue reading “Html.RenderAction Equivalent in .NET Core MVC”

Linq Style Mapping for Single Objects

Linq is not just the go-to .NET library for handling IEnumerable data sources, it’s the inspiration for many successful and unsucessful attempts to reproduce the style in other languages. When you have a class full of Linq and you find yourself wanting to simply map a single object to something else, you’ll find yourself writingContinue reading “Linq Style Mapping for Single Objects”