C# style object initialisation in TypeScript

@RoutingKey(‘abc’) class Foo { public name: string | undefined; public age: number | undefined; public gender: string | undefined; constructor(init?: Partial<Foo>) { if (init) { Object.assign(this, init); } } } const foo = new Foo({ name: ‘something’ }); https://stackoverflow.com/a/72028371/1515209 Read more →

Profile webpack

setup install https://github.com/stephencookdev/speed-measure-webpack-plugin npm install –save-dev speed-measure-webpack-plugin open the webpack config file – for me this was webpack.config.js the file contained the following: module.exports = { // … }; which is changed to const SpeedMeasurePlugin = require(“speed-measure-webpack-plugin”); const smp = new SpeedMeasurePlugin(); module.exports = smp.wrap({ // … }); results for me the biggest win I had this time was with… Read more →

Testing quality gates

Fail Fast Aspiration We achieve a level of automation that would give enough confidence to allow the majority of builds to automatically deploy (via the release pipeline) directly into production. Quality Gate 1: Developer Unit Tests All directly executable behaviour should be fully covered by unit tests, e.g. controller actions public methods shared functions extension methods etc. Unit tests should… Read more →

.net core catch all exception handler

app.UseExceptionHandler(options => { options.Run( async context => { var error = context.Features.Get<IExceptionHandlerFeature>(); if (error is object) { Log.Error( “EXCEPTION {method} {url} {query} => {exception}”, context.Request.Method, context.Request.Path.Value, context.Request.QueryString.Value, error.Error); } }); }); Read more →

OAuth2 scopes vs Roles

Scopes are typically used when an external application wants to gain access to the user’s data via an exposed API. They determine what the client application can do. Role (or group) based access is typically used within an application to determine what a user can do. https://stackoverflow.com/a/60943090/1515209 See also: https://www.linkedin.com/pulse/oauth-roles-scopes-pablo-cibraro/?articleId=6675773770986336256 Read more →

Reinstall Windows Store

Found here Navigate to https://store.rg-adguard.net/ Paste https://www.microsoft.com/en-us/p/microsoft-store/9wzdncrfjbmp into the box and click the tick scroll to the bottom and download Microsoft.WindowsStore_12107.1001.15.0_neutral_~_8wekyb3d8bbwe.appxbundle rename the file to Microsoft.WindowsStore_12107.1001.15.0_neutral_~_8wekyb3d8bbwe.appxbundle (it downloaded with a different name for me) double click and install Read more →

Docker – from the beginning

Install Docker desktop Docker.ApiServices.WSL2.WslKernelUpdateNotInstalledException: solution: install Hyper-V VSCode Install the Remote – Containers extension Angular sudo apt update sudo apt install nodejs npm sudo npm install -g @angular/cli@10.2.3 ng serve 2nd Attempt found this Image – docker pull debian:10-slim Container – docker run –name debian-buster-slim -h 10-slim -e LANG=C.UTF-8 -it debian:10-slim /bin/bash -l Environment – apt update && apt upgrade… Read more →

Developer Productivity

SPACE Satisfaction (and well being) These qualities are often best captured with surveys. To assess the satisfaction dimension, you might measure the following: Employee satisfaction. The degree of satisfaction among employees, and whether they would recommend their team to others. Developer efficacy. Whether developers have the tools and resources they need to get their work done. Burnout. Exhaustion caused by… Read more →