Articles

My Favorite Items I Found for 2023

In 2022 I found new tools that have made a big difference in my life. Here's my list of what I will be using in 2023 every day!

Submit a Static Website Form with Cloudflare Workers

Build a form on a static website. Use Cloudflare Workers to send an email on form submission, with Sentry to log errors & Google Captcha to prevent spam. All these can be used for free.

Set asp-append-version True by Default for JavaScript, & CSS to the Bust Cache

When I add a JavaScript file or CSS file in .NET, I want asp-append-version set to true 99.9% of the time. This way I don't have to tell users or testers to clear their cache. Here's an easy way to set the default to true to avoid writing it each time.

How to Debug SQL Exception: String or Binary Data Would Be Truncated in .NET EF Core

Ever run into a SQL Exception error where you tried to submit a string that was too long but you couldn't figure out which value caused the error?

Visual Studio - Unable to launch the IIS Express Web server

I run into this error on occasion, more often on old websites. Failed to register URL "http://localhost:{PortNumber}" for site {SiteName} application "/". Error description: The process cannot access the file because it is being used by another process. (0x80070020)

Using Tailwind CSS with Blazor

A quick guide to adding Tailwind to Blazor or any .NET project.

How to Get a CSS Variable with JavaScript and Set One Too

While working on a redesign, I needed a way for JavaScript to get the value of a CSS variable to determine the state of a page. Lucky for us, there is a browser compatible and easy method.

How to Set the Default Starting Directory in Windows Terminal

A quick guide to setting a default starting directory in Windows Terminal for multiple profiles, including WSL.

Create a Snippet or Shortcut in VS Code to Insert the Current Date & Time

Create a date and time snippet or keyboard shortcut with VS Code built in variables.

Making a PC Last a Decade

I built my 3rd personal PC this year. I've made a lot for and with other people, but only 3 for me. The previous 2 each lasted around 10 years each. Here's what has worked for me & the mistakes I've tried to discourage when I've built PCs for others.

Generate Lorem Ipsum with Microsoft Word

You can generate Lorem Ipsum in Microsoft Word with a =lorem(3,10) code followed by enter.

What is Vmmem? Is it safe? Why does it use so much CPU & Memory?

What is Vmmem? Why is it using so much memory & CPU? Don't worry, it's safe!

C# Use the Task Parallel library, including theParallel.For method, PLINQ, Tasks

In preperation for the Microsoft Programming in C# 70-483 exam, I've created a free study guide.

Microsoft C# Exam 70-483 Free Study Guide - Skip the Dumps & Pass the Programming Test

In preperation for the Microsoft Programming in C# 70-483 exam, I've created a free study guide.

Add Imports to Tailwind CSS with PostCSS

I've been enjoying Tailwind CSS as my main CSS tool for building components. One thing missing by default was how to use @import.

How to Turn on Detailed Exceptions in CircuitOptions.DetailedErrors with Blazor

I ran into the following error while working with Blazor. Error: There was an exception invoking 'MethodName' on assembly 'AssemblyName'. For more details turn on detailed exceptions in 'CircuitOptions.DetailedErrors'. Here's the fix.

Use Sass Variables In Typescript & Javascript

Having one true source of data is one of the first golden rules in software development. When creating components in JavaScript, you may want to add styles and classes that are also in your scss files. In an ideal world, you want to be able to make changes to these styles in one place and let your code update the rest.

My Favorite Books

As an avid reader, I often get requests for my favorite books. The following is a list I shared a while back with a friend. If you're interested in tech, coding, entrepreneurship, science or self-development, I think you'll find these enjoyable as well.

Clean Up & Sort Unused .NET Using Statements in Visual Studio

No need for an extension or ReSharper to sort and remove unnecessary using statements in .NET projects with Visual Studio. This is now built in, but you have to enable it.

How to use Default Props in React with TypeScript

Adding default props in React with TypeScript has been a pain. TypeScript 3 is making this process simple.

Use a TypeScript Definition Without Importing

There may come a time where you want to reference types in your TypeScript file without importing the code. This is common if you have a script tag somewhere else that is importing JavaScript from a public CDN of a popular library.

Oracle OTIN License Error installing Visual Studio

While installing Visual Studio with Xamarin, I ran into an error where it wouldn't download some of the Oracle parts. When clicking on the link for more information, it told me "In order to download products from Oracle Technology Network you must agree to the OTN license terms."

Difference Between Declarative and Imperative Programming in 60 Seconds

The terms declarative and imperative are often thrown around when talking about different styles in programming. Here's a short way to tell the difference.

Fixing Entity Framework Validation 30000 No Type Specified for the Decimal Column

Here's a quick fix for Entity Framework's Validation 30000 errors that show up on decimal columns.

NotSupportedException No IUserTwoFactorTokenProvider <TUser> named 'Default' is registered

While messing around with .NET Core 2 and Identity, I ran into this error.

How to Show the Current Active File in Visual Studio Solution Explorer

Trying to find your current active file in Visual Studio's Solution Explorer can be a pain. Here's how to make it less painful.

Scrape a Website & Send an E-mail with Azure Functions

Serverless Functions are an awesome way to create small tasks that can run on a schedule, by the click of a button or using your voice. We'll create a function that visits a website, collects important data & sends that via an e-mail back to us on a schedule.

Hosting Blazor on Netlify

Since Blazor is a frontend framework, we can host our Blazor apps on any serverless or static web host. The only requirement is that we can add minor configuration to redirect URLs so that all URLs point to our index.html page. Netlify fits this perfect. Netlify also happens to be my favorite host for static websites.

Add Coding Symbols to VSCode

As developers we spend more time reading code, than writing. One of the most common tasks we do are comparing items. Using symbols can make your code easier & more enjoyable to read.

How to Access the Hosting Environment in ConfigureServices

It can be useful to run different services in Development vs Production. The .NET Core templates do this within certain methods, such as the Configure method in the Startup class but there is no example of how to do it in the ConfigureServices method within the Startup Class.

Blazor Error - There is no Registered Service of Type

Experimenting with Blazor, I ran into this error. "There is no registered service of type...".

Cmder, My Favorite Windows Terminal

At a recent conference I learned about Cmder, an awesome terminal for Windows. I've only been using it for a couple of months, but here's what I really like.

Why is TypeScript Adding Class Comments to my Code

I noticed all my TypeScript compiled files had been modified after a recent change. I hadn't changed anything in them so this gave me some concern. What I found was TypeScript added a /** @class */ comment to the modified files.

What is CSP? Why & How to Add it to Your Website.

Cross-Site Scripting (XSS) sucks! It's found in 2 out of 3 websites. A CSP policy can help you avoid most XSS attacks. Here's how to add one and monitor it with ease.

Display Node.js Errors on a Windows IIS Server

If you are running IIS Node with a Node server on IIS and want your Node errors to show up instead of IIS errors, read this.

Why algorithms matter

I was working on learning algorithms & data structures. Reading the comments, many people were angry their solution worked but didn't pass all the tests. Performance on large data sets are why these matter though. Here are a couple of my attempts, plus a third I found online afterwards.

Adding Optional Parameters to a Javascript Function

Here's a great pattern for adding optional values to a function in JavaScript.

How to Ctrl+Alt+Delete in a Windows Remote Desktop Session

I can never remember the keyboard combination to use instead of Ctrl+Alt+Delete on a remote desktop.

How to add a Header

This a simple & short guide on how to add a header to different server architectures.

Keep Your Startup Clean

Don't let your Startup.cs file turn into a mess. Use extension methods to keep it clean.

How to Implement Terms of Service on Your Website

I often hear a lot of developer's say to just copy someone else's Terms of Service, make some minor changes & call it good. This is obviously not great legal advice. Today I actually learned some important concepts in regards to Terms of Service.

Fix Git Self Signed Certificate in Certificate Chain on Windows

You are in the right place if you're trying to use git clone on a computer and running into one of the following errors. SSL certificate problem self signed certificate in certificate chain or SSL certificate problem unable to get local issuer certificate.

What's the Difference Between Array<Type>, Type[], [Type] in TypeScript?

When defining an array in TypeScript you might think it is okay to define it using `[string]`. I have made this mistake several times & I find others making it often as well. This is actually defining a tuple, which is probably not the array you are wanting.

What is Concurrency and Parallelism?

Concurrency is the ability to break a job down into multiple tasks & work on those multiple tasks at the same time by switching back & forth between the tasks.

What is the Actor Model & When Should You Use it?

The more things change, the more they stay the same. In the 1970's computer scientists were pushing hardware to its limits. The engineers of the day had all sorts of hacks to squeak out performance.

The Power of Destructuring in JavaScript

In my free time, I've been messing around with a functional programming language built for the Erlang VM called Elixir. One of my favorite features of Elixir is pattern matching. As of ES6, we now have some pattern matching features in JavaScript. One of those is destructuring. Using destructuring will simplify your code & make it more readable.

Understand the Risks of Not Having a Secure Website

Over 80% of the top million websites either don't have a secure HTTPS website or they have one and aren't properly using it. This can cripple your business, even if you're not doing any financial transactions.

Switch to HTTP/2, The Easiest Way to Speed up Your Site

If content is king, the speed of your delivery may be queen. Slow websites lose readers & customers. Large companies have long recognized that every millisecond counts. 1/10 of a second costs Amazon 1% of their sales. 1/2 a second costs Google 20% of their traffic. That is a lot of money for those companies. Therefore they put immense effort into tactics to increase the speed of their sites. Fortunately for everyone, HTTP/2 eliminates the need for a lot of those tools.

What is Pattern Matching in Elixir?

I was confused about pattern matching for quite a while. Every time someone spoke of it, they said how it was one of their favorite features. When they explained what it was though, it was always different from the last person. After finally learning what pattern matching is, it all made sense. Pattern matching is used for a lot of different reasons.

Where to Begin Learning Elixir

I've been skimming a lot of resources lately on learning Elixir. My preferred learning method is to build things immediately, while learning the syntax and finer details along the way. I've never been a fan spending hours learning the finer details & not having anything to show for it.

TypeScript Cannot Invoke an Expression whose Type Lacks a Call Signature

I have a love|hate relationship with TypeScript. I love it when it works & hate it when it doesn't do what I think it should. I was trying to clean up some code and wrote the following

Outlook Mail Merge - Preview E-mails Before Sending & Use a Secondary Account

Today at the office, I was trying to help someone do a quick e-mail merge using Microsoft Office. There are actually times, this is the preferred method over MailChimp, which we also use. We had our Excel spreadsheet of data done, we typed up the e-mail in Word & inserted our mail merge tags. Then I found out we needed to send from their non-primary account.

Reasons Why Every Website Should Use SSL/HTTPS & Where to Get a Free SSL

An SSL is a certificate that allows you to have a secure website. Your address will use HTTPS instead of HTTP and the browser will show a lock symbol or color the address bar to signify this to your visitors.

Using Ternary Operators in ES6 String Templates

The new ES6 version of JavaScript introduced Template Strings which allow for improved readability of code when working with multiple line strings.

Visual Studio Crashes Due to NPM

I've just started using Visual Studio and so far the experience has been great. The Web Essentials plugin makes web development a lot better. Unfortunately Visual Studio has not been playing nice when I select to "Open a Website" that is using NPM.

Compile Sass with SassC and Libsass

Recently Foundation launched version 5 of their framework. This introduced me to Libsass and SassC, a library and wrapper that compiles Sass using C instead of Ruby.

SqlException: Arithmetic overflow error converting numeric to data type numeric.

I ran into this SQL Server error when using Entity Framework in a .NET Core project. It's a simple mistake easy to make.
Let's Connect