Mark Andrews
  • Home

What's New in .NET 7

Notes from the Pluralsight course: * Orleans project brought into .NET (Actor-Model pattern) * QuickGrid control added to Blazor * C# * Required properties * Improved string interpolation ($$) * File-scoped type (constrain scope to just that file) * Typeconverter * DateOnly and TimeOnly (not new) * API rate limiting * Output caching
25 Jan 2023

Design links

Visual design rules you can safely follow every timeThe HSB Color System: A Practitioner’s PrimerHue, saturation, and brightness, explained · Color variations with hue · Adjusting visibility with saturation · Black vs. white · HSL vs HSBLearn UI Design BlogErik D. KennedyColor Safe - accessible web color combinationsColor Safe is a tool to explore
24 Jan 2023 1 min read

Generate random string of chars with openssl

openssl rand -hex 32
08 Jan 2023

Use AWS CLI to authenticate a Cognito client and get access_token

Generate the secret hash via https://aws.amazon.com/premiumsupport/knowledge-center/cognito-unable-to-verify-secret-hash/ Then: aws cognito-idp initiate-auth --region ap-southeast-2 --auth-flow USER_PASSWORD_AUTH --client-id <clientid> --auth-parameters USERNAME=<username>,SECRET_HASH=<generated-secret>
07 Jan 2023

MAUI hot reload on Windows Machine

Hot reload worked on the Android emulator, but not the Windows 10 application. The solution was to add this build property to the .csproj <PropertyGroup> <DisableXbfLineInfo Condition="'$(ConfigurationName)' != 'Release'">false</DisableXbfLineInfo> </PropertyGroup>
22 Dec 2022

Get the name of a generic class (T)

Get the name of the class via reflection: typeof(T).Name; // Returns "Books" typeof(T).FullName; // Returns "MyApp.Classes.Books"
02 Sep 2022
dotnet

Seeding related entities with EF

modelBuilder.Entity<Post>() .HasMany(p => p.Tags) .WithMany(t => t.Posts) .UsingEntity<Dictionary<string, object>>( "PostTag", r => r.HasOne<Tag>().WithMany().HasForeignKey("TagId"), l => l.HasOne<Post>().WithMany().HasForeignKey("PostId"
26 Feb 2022
WSL

Puppeteer in Ubuntu WSL

Missing a few dependencies sudo apt install gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6
10 Feb 2022

CSS wildcard selectors

Return all divs with class wildcard div[class*=alert-] Returns alert-danger and alert-info
05 Feb 2022

Upgrading Ghost running on a Digital Ocean droplet

It's one-click install, but updates need to be done manually. Configure terminal/Filezilla for SSH access, backup content, use the ghost-cli to do the update.
04 Feb 2022

Next.js _document and _app

_document.jsx - rendered on the server, not called by the client. Good for <head> etc. _app.jsx - rendered by the client, manage state here
02 Feb 2022
JavaScript

ES2018 Spread operator object literals

Spread operator applied to object literals and not just arrays const obj1 = { "firstName": "James", "lastName": "Holden" } const obj2 = { ...obj1, "rank": "captain" } const addRank = true; console.log(obj2); // { firstName: "James", lastName: "Holden", rank: "captain&
01 Feb 2022
technology

yarn --frozen-lockfile to pin dependencies

yarn install --silent --production=true --frozen-lockfile
11 Jan 2022
JavaScript

Async/await example with promises

const asyncTask = () => new Promise((_resolve, reject) => setTimeout(() => reject("Something not working!"), 1e3) ); const foo = () => asyncTask() .then(console.log) // Logs Promise .catch(console.error) // Logs the failure .finally(() => console.log("After calling AsyncTask")); // Logs the completion foo(); Source
16 Nov 2021
JavaScript

Array and Object explorer

Array explorer Object explorer
15 Jul 2019
linux

Ubuntu upgrade individual packages

Stuff I always forget
13 Jul 2019
Azure

Clone all Devops repos

Powershell to clone all repos in Devops project
08 Jul 2019
Azure

Azure cli access to Devops

Script access to Azure Devops repos/pipelines/boards
08 Jul 2019
JavaScript

Shallow array comparison function

Shallow compare using Array​.prototype​.every()
09 Jun 2019
JavaScript

Set operator to remove duplicate array elements

Spread and Set operators
09 Jun 2019
Angular

Angular ng upgrade

ng upgrade
29 May 2019
dotnet

.NET Code Analysis in VS2019

FXCop code analysis on all projects without installing
28 May 2019
Mobile

Publish Progressive Web App to Google Play as Trusted Web App

Publish an app in the Play Store that links to PWA
18 May 2019
editor

VIM tips

Stuff I always forget ...
13 May 2019 1 min read
Integration

API Content Types

Outline of the 3 content types
13 May 2019
← Newer Posts Page 2 of 3 Older Posts →
Mark Andrews © 2026
  • Privacy
Powered by Ghost