Skip to content

Instantly share code, notes, and snippets.

Avatar

Jon LaBelle jonlabelle

View GitHub Profile
@jonlabelle
jonlabelle / NormalizeLineEndings.cs
Last active Nov 20, 2020
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
@jonlabelle
jonlabelle / bash_special_parameters_reference.md
Last active Feb 9, 2020
The shell treats several parameters specially. These parameters may only be referenced; assignment to them is not allowed.
View bash_special_parameters_reference.md
@jonlabelle
jonlabelle / msbuild-dotnet-aspnet-build.md
Last active Oct 9, 2020
Build, Publish and Deploy ASP.NET Web Applications from the Command Line
View msbuild-dotnet-aspnet-build.md
View keybase.md

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:

You can’t perform that action at this time.