Skip to content

Instantly share code, notes, and snippets.

View jonlabelle's full-sized avatar

Jon LaBelle jonlabelle

View GitHub Profile
@jonlabelle
jonlabelle / NormalizeLineEndings.cs
Last active August 22, 2023 13:28
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>
@jonlabelle
jonlabelle / MyProject.csproj
Created October 11, 2020 14:38
How to specify multiple target frameworks in SDK-style projects
<!-- ==========================================================================
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 September 14, 2020 23:53
Upload to file.io shell script.
#!/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 February 22, 2023 05:59
Bash script to convert a web page URL to Markdown using Pandoc.
#!/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 April 28, 2020 19:34
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.
@jonlabelle
jonlabelle / macos_screenshot_keyboard_shortcuts.md
Created March 4, 2020 04:53
macOS Screenshot Keyboard Shortcuts
@jonlabelle
jonlabelle / bash_special_parameters_reference.md
Last active February 9, 2020 10:14
The shell treats several parameters specially. These parameters may only be referenced; assignment to them is not allowed.
@jonlabelle
jonlabelle / msbuild-dotnet-aspnet-build.md
Last active March 22, 2024 16:23
Build, Publish and Deploy ASP.NET Web Applications from the Command Line

Keybase proof

I hereby claim:

  • I am jonlabelle on github.
  • I am jonlabelle (https://keybase.io/jonlabelle) on keybase.
  • I have a public key whose fingerprint is B87D 15C4 A889 D39C 2972 B0EB B07D E25F 5E87 7F05

To claim this, I am signing this object: