Skip to content

Instantly share code, notes, and snippets.

View ericnewton76's full-sized avatar

Eric Newton ericnewton76

  • Orlando Florida
View GitHub Profile
@FeodorFitsner
FeodorFitsner / update-global-assemblyinfo.ps1
Created January 6, 2016 23:04
Update global assemblyinfo with build number
$assemblyFile = "$env:APPVEYOR_BUILD_FOLDER\src\GlobalAssemblyInfo.cs"
$regex = new-object System.Text.RegularExpressions.Regex ('(AssemblyInformationalVersion(Attribute)?\s*\(\s*\")(.*)(\"\s*\))',
[System.Text.RegularExpressions.RegexOptions]::MultiLine)
$content = [IO.File]::ReadAllText($assemblyFile)
$version = $null
$match = $regex.Match($content)
if($match.Success) {
@ericnewton76
ericnewton76 / StringBuilderExtensions.cs
Last active December 20, 2015 07:19
An extension to StringBuilder for ReplaceAt functionality. Given an index, and optional length, and a string to overwrite, this method overwrites an area of characters.
namespace System.Text
{
internal static class StringBuilderExtensions
{
#if EXTENSIONS_SUPPORTED
public static StringBuilder ReplaceAt(this StringBuilder sb, string value, int index, int count)
{
return StringBuilderExtensions.ReplaceAt(sb, value, index, count);
}
#endif