Shane Bartholomeusz

Geek and lover of all things tech related

Tag: Web Development (page 1 of 2)

Quick Tip: VS Code Restore Previous File Version

Overview

Have you ever found yourself in a situation where you’ve modified a local code file and needed to revert back to a previously saved local version that was not committed to your Git repo?

If you’re a user of Visual Studio Code you’re in luck because I’ll show you how to do just that …

VS Code Icon
Continue reading

How To: Generate Swagger REST API Client

Overview

As the web continues to grow and evolve, API’s are where all the magic happens that powers this innovation. REST API’s have become increasingly more favoured by developers for their ease of use over other alternatives (XML I’m looking at you).

Unfortunately, REST API’s can sometimes become a bit unwieldy in terms of documenting them, and consuming them. It is for this reason that Swagger was born! Swagger will autogenerate documentation for your REST API in the form of an Open API specification (swagger.json) document (formerly Swagger Specification). This makes it much easier for developers to understand and consume an API.

Third-party developers can then use the swagger.json specification file to either manually create an API client or auto-generate one for the preferred language of choice.

In this post, I’ll show you how to autogenerate a C# REST API client from a swagger.json in a few easy steps.

Swagger Logo
Continue reading

Solved: Angular – Invalid version: “15.2-15.3”

Problem

Whilst working on a new Angular project I recently came across an unusual error when trying to build a new project generated through the Angular CLI.

In this post, I’ll explain how I resolved this issue.

> ng build

√ Browser application bundle generation complete.
An unhandled exception occurred: Transform failed with 1 error:
error: Invalid version: “15.2-15.3”
See “XXXXXX\angular-errors.log” for further details.

Angular logo
Continue reading

How To: Deep Clone a JavaScript Object

Overview

JavaScript is becoming ever increasingly more popular as time goes by. While JavaScript has many advantages, it also has many interesting quirks or nuances that can catch out new beginners.

In this post I’ll show you how to deep clone a JavaScript object.

Problem

Okay … before we go any further … lets take a step back and understand the problem at hand.

Objects in JavaScript are passed by reference, meaning that any object returned by a function will point to the same memory reference as the original object. Therefore if the caller of the function modifies the returned object, they will actually be changing the original source object.

Javascript Icon
Continue reading

How To: Debug Angular apps with Google Chrome in VSCode

Overview

VSCode is a fantastic IDE for editing <insert your favourite language here> source code. Likewise Angular is a great framework for developing front-end web apps.

When developing applications, we developers usually spend most of our time in the debugger. However, out of the box there is a little bit of setup required to enable debugging of an Angular TypeScript application when using VSCode.

In this post I’ll show you how to configure VSCode debugging for an Angular TypeScript application with the Google Chrome web browser.

Angular logo
Continue reading

Visual Studio: Generate Class From JSON String

Overview

If you work JSON documents, I’m sure you’ve probably had to create a class file from a JSON string. Doing this manually can be a real pain in the proverbial, especially if you are working with a large JSON document. It can also be very error-prone. Therefore it’s best to automate this conversion.

In this post I’ll show you how to automatically generate a class file from a JSON string using a little known feature built into Visual Studio.

Visual Studio Icon
Continue reading

Visual Studio: Show Current File in Solution Explorer

Overview

Have you ever worked on a large Visual Studio project that contained many projects and become somewhat disorientated, unable to find the currently open file within the Solution Explorer pane?

I did just that recently … I started work on a large Visual Studio solution for a client which contained over 180 projects within a single solution. Yep, I’m not even joking!

Whilst trying to learn and understand the solution structure I found myself getting lost inside the sea of nested projects and folders contained within the solution.

Well guess what? You’re in luck because I’ll show you a little known feature that may help you.

Visual Studio Icon
Continue reading

Solved: BlazorInputFile ‘No File Chosen’ Error

Blazor WebAssembly Icon

Problem

Blazor is an exciting new technology for .NET developers that enables us to leverage our core strengths by writing most of the code in C# and minimising the need to write JavaScript code.

While working on a Blazor WebAssembly solution that used Steve Sanderson’s BlazorInputFile solution I came across an unusual issue where the “No File Chosen” text would not change and the selected filename did not appear even though a file had already been selected.

Hmmmm … what’s going on here?

HTML File Input Screenshot
Continue reading

How to: Implement Azure Web App Authentication – The Easy Way

Overview

Let’s face it … security is HARD. Implementing authentication and authorization into applications has always been a challenge and a chore for developers. Building a secure application requires strong knowledge across a number of areas.

Thanks to the power of Easy Auth on Microsoft Azure it’s easier than ever to setup secure authentication for your web application with the click of a few buttons… Yep, I’m not kidding!

Ok let’s get started …

Azure App Service Logo
Continue reading

How To: Google Analytics In Chrome Extensions

Background

Google Analytics

Google has replaced its legacy analytics library https://ssl.google-analytics.com/ga.js with the new and improved Universal Analytics library https://www.google-analytics.com/analytics.js.

I’ve been working on a Google Chrome Browser Extension but had some trouble integrating it with Google Analytics. Google’s own tutorial hadn’t yet been updated to use the new analytics library. In this post I’ll explain how I did it.

Continue reading

Older posts

© 2024 Shane Bartholomeusz

Theme by Anders NorenUp ↑