Skip to content

Instantly share code, notes, and snippets.

@jonlabelle
jonlabelle / dotnet-format-wrapper.sh
Last active Mar 2, 2021
Bash wrapper script for the .NET Format global CLI tool.
View dotnet-format-wrapper.sh
#!/usr/bin/env bash
#
# Bash wrapper script for the .NET Format global CLI tool.
#
# Author........: Jon LaBelle
# Date..........: February 4, 2021
# Snippet.......: https://jonlabelle.com/snippets/view/shell/net-format-bash-wrapper-script
# Gist..........: https://gist.github.com/jonlabelle/a0751768a220274a90d4be498da51643
# .NET Format...: https://github.com/dotnet/format
@jonlabelle
jonlabelle / dontet_unit_test_framework_translation_cheatsheet.md
Last active Feb 26, 2021
.NET Unit Test Framework Translation Cheatsheet
View dontet_unit_test_framework_translation_cheatsheet.md
@jonlabelle
jonlabelle / ldap_search_filter_cheatsheet.md
Last active Jan 28, 2021
LDAP Search Filter Cheatsheet
View ldap_search_filter_cheatsheet.md
@jonlabelle
jonlabelle / NormalizeLineEndings.cs
Last active Feb 26, 2021
Normalize line endings in C#.
View NormalizeLineEndings.cs
/// <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>
@jonlabelle
jonlabelle / MyProject.csproj
Created Oct 11, 2020
How to specify multiple target frameworks in SDK-style projects
View MyProject.csproj
<!-- ==========================================================================
How to specify multiple target frameworks in SDK-style projects
- File: MyProject.csproj
- Source: https://docs.microsoft.com/en-us/dotnet/standard/frameworks#how-to-specify-a-target-framework
When you specify multiple target frameworks, you may conditionally reference
assemblies for each target framework. In your code, you can conditionally
compile against those assemblies by using preprocessor symbols with
@jonlabelle
jonlabelle / file.io.sh
Created Sep 14, 2020
Upload to file.io shell script.
View file.io.sh
#!/bin/sh
# ========================================================
# 100 uploads per day, 5GB file size limit for FREE plan.
# ========================================================
URL="https://file.io"
DEFAULT_EXPIRE="14d" # Default to 14 days
if [ $# -eq 0 ]; then
@jonlabelle
jonlabelle / url2markdown.sh
Last active Aug 23, 2020
Bash script to convert a web page URL to Markdown using Pandoc.
View url2markdown.sh
#!/usr/bin/env bash
function url2markdown()
{
if [ -z "$1" ]; then
echo "Usage: url2markdown <url|path> [outfile.md]"
echo ""
echo " Converts the specified URL (or path) to Markdown using Pandoc."
echo ""
echo " If [outfile.md] (arg 2) is not specified..."
@jonlabelle
jonlabelle / configure_firefox_for_integrated_windows_authentication.md
Last active Apr 28, 2020
By default, Firefox does not support Integrated Windows Authentication and you are prompted for a User Name and Password when accessing such a site. The following steps outline how to override this default behavior, and trust specific site(s) for silent NTLM authentication.
View configure_firefox_for_integrated_windows_authentication.md
View macos_screenshot_keyboard_shortcuts.md