Related to How to migrate usage of StringBuilder+TagBuilder for HTML rendering?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Utility | |
{ | |
/// <summary> | |
/// Buffer-copy the specified StringBuilder contents into a text writer. | |
/// </summary> | |
/// <param name="stringBuilder"></param> | |
/// <param name="stringWriter"></param> | |
/// <returns></returns> | |
public static long CopyTo(this StringBuilder stringBuilder, TextWriter stringWriter) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Somewhere | |
{ | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
// from <https://gist.github.com/sandrock/d1fb3040e1c9326d8dd16b3bad8930ac> | |
/// <summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
value=v1.20.03-xx7 | |
semver=$(echo "$value" | sed -r "s/^v?([0-9]+)\.([0-9]+)\.([0-9]+)(.*)$/\1 \2 \3 \4/") ; semver=( $semver ) | |
echo "result: ${semver[0]} ${semver[1]} ${semver[2]} ${semver[3]}" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace SrkToolkit.Common | |
{ | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
/// <summary> | |
/// Proxies a collection of <typeparamref name="TSource"/> into a collection of <typeparamref name="T"/> using a direct cast mehod. | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Usual encodings | |
================ | |
1200 utf-16 Unicode | |
1252 Windows-1252 Western European (Windows) | |
28591 iso-8859-1 Western European (ISO) | |
65001 utf-8 Unicode (UTF-8) | |
Other encodings | |
================ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Somewhere | |
{ | |
using System; | |
using System.IO; | |
using Microsoft.Win32; | |
internal sealed class JavaRuntimeCheckTask | |
{ | |
public void Verify(PackageContext context) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace System | |
{ | |
using System.Globalization; | |
// source: https://gist.github.com/sandrock/6fe3298b8ac6d9d0d9872dd811a63908 | |
/// <summary> | |
/// Extension methods for common types that provide ToInvariantString() capability. | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MyWebApi | |
{ | |
public abstract class ApiController : System.Web.Http.ApiController | |
{ | |
/// <summary> | |
/// Returns a NotFound HTTP result (404) with a negotiated full-bodyed result. | |
/// </summary> | |
/// <returns></returns> | |
protected override System.Web.Http.Results.NotFoundResult NotFound() |
NewerOlder