Skip to content

Instantly share code, notes, and snippets.

@developerprofiles
developerprofiles / NormalizeLineEndings.cs
Created February 26, 2021 10:46 — forked from jonlabelle/NormalizeLineEndings.cs
Normalize line endings in C#.
/// <summary>
/// Normalize line endings.
/// </summary>
/// <param name="lines">Lines to normalize.</param>
/// <param name="targetLineEnding">If targetLineEnding is null, Environment.NewLine is used.</param>
/// <exception cref="ArgumentOutOfRangeException">Unknown target line ending character(s).</exception>
/// <returns>Lines normalized.</returns>
/// <remarks>
/// https://jonlabelle.com/snippets/view/csharp/normalize-line-endings
/// </remarks>
title subtitle author date source notoc
PowerShellGet Commands
PowerShell command examples to discover, install, update and publish PowerShell artifacts, and from the online PowerShell Gallery
Jon LaBelle
June 1, 2019
false

*PowerShellGet is a module with commands for discovering, installing, updating

IIS Config File Paths

Internet Information Services (IIS) 7 and later use an XML-based configuration system for storing IIS settings which replaces the metabase that was used in IIS 6.0 and earlier. This new configuration system was introduced with ASP.NET and is based on a hierarchical system of management system that uses *.config files. The configuration files for IIS 7 and later are located in the %windir%\System32\inetsrv\config folder.

applicationHost.config

@developerprofiles
developerprofiles / clean_dotnet_build_files.sh
Created February 26, 2021 10:46 — forked from jonlabelle/clean_dotnet_build_files.sh
Delete dotnet build dirs and files ('bin', 'obj', etc) recursively, starting from the current working directory.
#!/usr/bin/env bash
#
# Delete dotnet build dirs and files (e.g. 'bin', 'obj', etc...)
# recursively, starting from the current working directory (PWD).
#
# TODO:
# - Handle unknown options passed in as arguments
#
# Author: Jon LaBelle
@developerprofiles
developerprofiles / Settings.StyleCop
Created February 26, 2021 10:46 — forked from jonlabelle/Settings.StyleCop
StyleCop settings
<StyleCopSettings Version="105">
<GlobalSettings>
<CollectionProperty Name="RecognizedWords">
<Value>upsert</Value>
<Value>api</Value>
<Value>deserializer</Value>
<Value>deserializing</Value>
<Value>json</Value>
<Value>json:api</Value>
</CollectionProperty>
@developerprofiles
developerprofiles / dotnetcheatsheet.md
Created February 26, 2021 10:46 — forked from jonlabelle/dotnetcheatsheet.md
Dotnet core Cheat Sheet
@developerprofiles
developerprofiles / ConsolePortScanner.cs
Created February 26, 2021 10:46 — forked from jonlabelle/ConsolePortScanner.cs
Simple async C# Open Port Network Scanner
using System;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Net.Sockets;
namespace ConsolePortScanner
{
class MainClass

Windows to UNIX Command Cheat Sheet

Windows PowerShell has several transition aliases that allow UNIX and CMD users to use familiar command names in Windows PowerShell. The most common aliases are shown in the table below, along with the Windows PowerShell command behind the alias and the standard Windows PowerShell alias if one exists.

CMD Command UNIX Command PowerShell Command PowerShell Alias
dir ls Get-ChildItem gci
@developerprofiles
developerprofiles / async_await_best_practices_cheatsheet.md
Created February 26, 2021 10:48 — forked from jonlabelle/async_await_best_practices_cheatsheet.md
C# Asynchronous Programming Guideline Cheat Sheet

Async Await Best Practices Cheat Sheet

Summary of Asynchronous Programming Guidelines

Name Description Exceptions
Avoid async void Prefer async Task methods over async void methods Event handlers
Async all the way Don't mix blocking and async code Console main method
Configure context Use ConfigureAwait(false) when you can Methods that require con­text