Host your Hugo site on Azure Storage

deployed with VSTS

I’m a big fan of Static Site Generators (SSGs) for basic websites like this blog. By removing all the moving parts we can host blazing fast sites directly out of Azure Storage at very low cost. In this post I’ll cover how to host a static website created with Hugo under a custom domain using Azure Storage (Static Sites) and Cloudflare which is automatically deployed from GitHub using Azure DevOps. [Read More]

Using Azure Functions to text you when your servers are down

So I’ve just read a great blog post by Nick Malcolm on Using AWS Lambda to call and text you when your servers are down. The thing I like most about it is that it’s serverless so no infrastructure to maintain and worry about. However, not everyone is on AWS. The environment I want to monitor is all hosted in Azure! Turns out Azure also fully supports this serverless set up and it’s just as easy, if not easier, to do the exact same thing using Azure Functions and Alerts. [Read More]
guide  azure 

Could not load file or assembly 'Microsoft.VisualStudio.Web.PageInspector.Loader...

VS 2017 RC is out, no better time to go remove any old versions of Visual Studio I have lying around. However, when I uninstalled an old version of VS 2012 Express - boom, all my local sites stopped working with the following missing assembly error. Could not load file or assembly 'Microsoft.VisualStudio.Web.PageInspector.Loader, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The module was expected to contain an assembly manifest. It looks like it’s an assembly that VS 2012 adds which is why it’s no longer available after uninstall, but we are still trying to reference it somewhere. [Read More]

Update multiple Git repositories on Windows at once using Powershell

If you’ve got a bit of time there’s plenty of guides on how to set up Git and Powershell but to make things simple we’re just going to go ahead and download GitHub Desktop. Phil Haack did a pretty good job at convincing me that even though GitHub Desktop is a GUI app - it’s a great way to get the Git command line set up and kept up to date also. [Read More]

How to import Python extension modules in Azure Functions

An awesome feature of Azure Functions is its ability to run a wide range of languages, C#, F#, Node.js, Python, PHP, batch, bash, Java, or any executable. So when I wanted to do a bit of work with the Google Eddystone beacon format it was a natural fit as I just needed to quickly run a few Python methods - given the example code Google provides is in Python. [Read More]

Optional arguments in C# interfaces

Optional arguments are a nice feature in C# that have been around for a while now, they were introduced back in 2010 with C# 4. They are often mentioned in the same breath as named arguments but are two completely different concepts. The great thing with development is that there’s always something new to learn, this week it for me it was the behaviour of optional arguments on interfaces that don’t match the optional argument on the implementing class even though the feature has been around for what? [Read More]
csharp 

Running Go on Azure App Services

At first I thought I was going to have to go something tricky - Wade Wegner has a great write up of one method here, but it turns Azure App Services have now added native Go support so we don’t need to set up Go on the server any more. The versions currently supported on the Azure App Service platform are 64bit Go 1.4.2 and Go 1.5.1 and it turns out to be super simple to get going. [Read More]
go  guide  azure 

Getting started with Go on Windows

I’m giving this Go-lang thing a whirl, turns out it’s dead easy to set up on Windows. First download and install Git if you don’t have it already - when using Go you’ll user a lot of open source! Next download and install the latest 64-bit Go MSI distributable from https://golang.org/dl. Run that hit next, next, next and let it set up all the defaults. Once that’s done open up the CMD and type go version if everything is running you should get something like go version go1. [Read More]
go  guide 

Creating custom Knockout bindings in TypeScript

In Javascript you create a custom knockout.js binding like this //Initialise the binding to the value in the input ko.bindingHandlers.initValue = { init: function (element, valueAccessor) { valueAccessor()($(element).val()); } }; But in TypeScript you’ll get the error Property 'initValue' does not exist on type 'KnockoutBindingHandlers'. Just create a {something}.d.ts definition file for your custom bindings, something like knockout.bindings.d.ts and provide a definition for your binding. interface KnockoutBindingHandlers { initValue: KnockoutBindingHandler; } Now it will transpile correctly. [Read More]

Func<T> vs. Expression<Func<T>> in LINQ

Linq is fantastic in that it provides a consistent syntax to query all sorts of data from in-memory collections, SQL databases, XML files, even external APIs. One of it’s strengths is that you can write a Linq provider for any data source the you want to support. Most people know about the “not obvious until it’s obvious” difference between IEnumerable<T> and IQueryable<T> - one represents an in-memory collection and one represents a query which will be executed at some point against a data source. [Read More]
csharp  linq