Mark Andrews
  • Home
JavaScript

ESLint / Prettier column width

Changing from default 80 to 120 characters
26 Apr 2019

Bash tips

Collating useful commands
16 Apr 2019
dotnet

Core Razor Pages

First observations of Core Razor Pages
04 Apr 2019 1 min read
SQL

Visual guide to SQL joins

https://blog.codinghorror.com/a-visual-explanation-of-sql-joins/
12 Mar 2019
technology

VIM cheat sheet

https://www.fprintf.net/vimCheatSheet.html
07 Mar 2019
SQL Server

diff two SQL Server tables

From Stack Overflow SELECT t1.id FROM table1 t1 INNER JOIN table2 t2 ON t1.id = t2.id WHERE ISNULL(t1.field1,'') <> ISNULL(t2.field1,'') OR ISNULL(t1.field2,'') <> ISNULL(t2.field2,'') ...
05 Mar 2019
git

Git tips

How do I modify a specific commit?I have the following commit history: HEAD HEAD~ HEAD~2 HEAD~3 git commit --amend modifies the current HEAD commit. But how do I modify HEAD~3?Stack OverflowSam Liao append ^ to the commit hash Store GitHub PAT in ~/.git-credentials, content: https://<
21 Jan 2019 2 min read
Integration

API testing with Postman and Newman

Add some test assertions to Postman requests used in development, and run them with Newman - voila automated integration tests. https://medium.com/@arthurgomesfaria/automating-apis-testing-with-postman-and-newman-a9a9ef0354d4
20 Dec 2018
a11y

Accessible input focus hiding

Here is how to remove the input focus element for mouse users but have it remain for keyboard users.
20 Dec 2018
dotnet

CORS pre-flight OPTIONS request depends on Content-Type

The spec shows that an XHR request only sends the OPTIONS pre-flight request with some content-types. It does not send an OPTIONS request with application/x-www-form-urlencoded but does with form-data or raw JSON. This knowledge can save a lot of pain when trying to call an MVC endpoint with an
19 Dec 2018
dotnet

Integration testing Web API endpoints with MSTest

Using in-memory server [TestMethod] public void Get() { var client = new HttpClient(); var request = new HttpRequestMessage { RequestUri = new Uri("http://localhost/api/hello"), Method = HttpMethod.Get }; request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); using (var response = client.SendAsync(request).Result) {
29 Nov 2018 1 min read
JavaScript

Angular Material, cli, karma

From the error messages that give you the answer but it's still not clear department. Angular tests were throwing this error: Failed: Template parse errors: 'mat-card' is not a known element: 1. If 'mat-card' is an Angular component, then verify that it is part
04 Jun 2018 1 min read
dotnet

Swagger and the IHttpActionResult return type

Swagger is great for documenting APIs. Using an IHttpActionResult return type, however, means that Swagger does not know the data structure that will be returned: The fix Decorating the controller action method with the below ensures that Swagger is aware of the context. [System.Web.Http.Description.ResponseType(typeof(IEnumerable&
19 Mar 2018 1 min read
dotnet

Swagger and https

Swagger is great for documenting APIs, and installs easily via Nuget. However, it can be problematic over https, with an error "Can't read from server. It may not have the appropriate access-control-origin settings.". The solution The page is being loaded with the https:// protocol, however, Swagger
19 Mar 2018 1 min read
SQL Server

SQL Server convert IDENTITY column to non-IDENTITY

I made a fundamental mistake in the database architecture, and learnt that identity columns are great for programmatically generated database rows, however, for prescriptive data (such as a list of categories that does not change via the UI) then the id column is best managed manually to ensure consistency between
08 Mar 2018 1 min read
Azure

LUIS, bot framework, and the 'None' intent

So my bot was handling words like 'fsdfd' correctly, but any real words, for which I did not have an utterance defined in any intent, were being handled unexpectedly. For example, 'blue', 'student', and 'dog' were all being handled by the '
12 Feb 2018
Azure

Deploying Node.js to Azure with restify

In following the generally-excellent Azure documentation, my NodeJS app would deploy from GitHub, build, and be available, however, it would not respond to hitting REST endpoints. Checking the Azure logs showed restify listening to http://undefined:undefined which to me meant it was listening to nothing. It should get the
12 Feb 2018
dotnet

Implementing IHttpActionResult in Web API 2

Default return type The default return type on Web API 2 controllers is a C# class or collection: // GET: api/Test public IEnumerable<string> Get() { return new string[] { "value1", "value2" }; } I love that abstraction: the framework builds the http response; headers, response code, and
09 Feb 2018 1 min read
Ghost

Prism on Ghost with Casper theme

There is a lot of inconsistent doco out there, so here are the latest settings to get C# syntax highlighting in a Ghost installation using the default Casper theme. Code Injection -> Blog Header <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/prism/1.
09 Feb 2018 1 min read
Featured

Hello world

The best time to create this blog was 15 years ago. Now is the current best time, so here it is.
09 Feb 2018
← Newer Posts Page 3 of 3
Mark Andrews © 2026
  • Privacy
Powered by Ghost