Code Articles
As a developer I often write scripts to automate processes and create code generation items. Other times it is to capture code that is used frequently but time consuming to write. I also like to try different coding techniques from blogs that I read and keep snippets to add to existing programs or as a knowledge base for me.
Please feel free to take code from these pages for your own use. Most of these scripts are written using C# and my tool of choice is usually LINQPad. This allows me to run scripts and reference libraries or nuget packages without having to write a new console project each time
Categories
Scripts
- Detect Disposable Email Addresses
C# Script to get list of disposable email domains to then block - Create Visual Studio code snippet
C# Script to generate the code snippet markup for Visual Studio
Code Generation
- ASP.NET Core Email TagHelper
Create and Render Custom Tag Helpers - Create structured markup with JSON-LD
How to dynamically create JSON-LD with C# - Fluent sitemap generator
Create the Sitemap.xml markup for search engines - Auto-generate C# classes from database schema
Using Information_Schema views classes from views and tables - TSql Generate Alter Table Statement
C# Script to generate If Column Exists Alter Table SQL
Techniques
- Log the calling method using C#
Use System.Diagnostics to log the calling method in C# - Avoid reserved words in Sql statements
Script reads from Clipboard and checks for Sql Reserved words - Case of the Non-Breaking Space Part II
Replace non-breaking space (\u00A0) with (\u0020) - Case of the Non-Breaking Space Part I
How to identify a non-breaking space in your code
For Fun
- Create a Lottery Generator
A common opening technical question is to create a lottery generator - New Music Friday with Html Agility Pack
Use Html Agility Pack and XPath to Scrape Album of the Year