Using Service Connections in Azure DevOps

I was recently setting up a build pipeline in Azure DevOps and realised I didn’t have access to the Azure resources to be able to pick the app service as a deployment target.
The easy way would be to get my account access to the Azure resources, but:

  1. I’d be the only one with the ability to change those deployment options, or at least new devs would to get access as well before they could.
  2. The onsite guy for that kind of access was away.

VSCode Extension: Hugo syntax highlighting for Markdown

Some time ago, just after the first post on this blog, I started using Hugo Shortcodes.
The theme I was (still am) using didn’t have great support for some of the markdown stylings that I wanted, and instead of fiddling with that, I figured I’d create my own with custom styles and Hugo Shortcodes.

Angular Transclusion With Parameters

I recently came across a scenario where I had several components with the same structure in them, so I figured I’d extract it out into it’s own component.
Simple right? Everyday scenario?
Were it so easy…

Service Worker Updates

Service workers are the new hotness when it comes to web applications.
They allow a website to have some offline behaviours similar to that of an app, including an “installable” desktop experience.
In essence, they’re a small app that browsers can interpret and run, caching info and queueing requests, enabling offline access and data-saving.

Visual Studio and VS Code Tips and Tricks

A colleague mentioned they weren’t aware of Logpoints in Visual Studio, so here’s some things that aren’t on or known about by default (usually because they’re experimental or stylistic)

Some that I’ve found useful:

  • Logpoints
  • Cursor animations
  • Semantic highlighting
  • Parallel stacks
  • Output window filters
  • Unreferenced assembly Intellisense

Node as a Dependency

Managing node versions can become painful when switching between projects.
There’s a mechanism to check node versions during an npm install called Engines, but that doesn’t help if the projects are installed already.
The fix is to install node as a dependency. Who would have thought?

Casting NaN to Numerics

I came across an interesting problem today where a cast from double to int resulted in int.MinValue. Further digging revealed that it was a NaN problem. How did I get a NaN in simple C#? Damn divide by zero, that’s how. But wait, how did I not get an exception? I had: double first = 0; double second = 0; var result = (int)Math.Round(first / second); In the above case, result was -2147483648, but why!

Hugo Syntax Extension: Revisited

Hugo Shortcode Syntax Highlighter VSCode extension is live!

Migrating to dotnetcore 3.1 (mostly EFCore)

Dotnetcore 3 has been out for a little while now, and there were some changes I wanted in the project I was working on, so off I went and gave it a burl.
Needless to say, there were some issues, but in fairness, some of it was our fault.

C# - Static members in Generic classes are weird

Generic classes are useful coding constructs that I thought I mostly understood, but I had an issue with them recently that blew my mind… Static members in Generic classes don’t work as I naively expected.