I hereby claim:
- I am thoemmi on github.
- I am thoemmi (https://keybase.io/thoemmi) on keybase.
- I have a public key ASD1LqmfVwJ9qgVmFamgIyLV28FTLDOwzDiIph2oyBtA9go
To claim this, I am signing this object:
| public static class AnsiConsoleExtensions | |
| { | |
| public static IAnsiConsole WriteJson(this IAnsiConsole console, JsonElement node, JsonStyle? jsonStyle = null) | |
| { | |
| ArgumentNullException.ThrowIfNull(console); | |
| ArgumentNullException.ThrowIfNull(node); | |
| console.WriteJson(node, jsonStyle ?? JsonStyle.Default, 0); | |
| return console; | |
| } |
I hereby claim:
To claim this, I am signing this object:
| public class EnumFlagsConverter : JsonConverter | |
| { | |
| public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) | |
| { | |
| var x = ((Enum) value).ToString(); | |
| var list = new List<string>(); | |
| foreach (var v in x.Split(new[] {", "}, StringSplitOptions.RemoveEmptyEntries)) | |
| { | |
| list.Add(v); |
| [CmdletBinding()] | |
| param( | |
| [Parameter(Mandatory=$true, HelpMessage="Path to work item template definition file")] | |
| [string] | |
| $witdPath | |
| ) | |
| # path to dot.exe; e.g. use "choco install graphviz" | |
| $dotPath = "C:\ProgramData\chocolatey\bin\dot.exe" |
| [CmdletBinding(SupportsShouldProcess=$True)] | |
| Param( | |
| [int]$CutoffDays = 150 | |
| ) | |
| $cutoffDate = (Get-Date).AddDays(-$CutoffDays) | |
| # get path to cached NuGet packages ("%USERPROFILE$\.nuget\packages") | |
| $nugetCachePath = Join-Path "$([System.Environment]::GetFolderPath([System.Environment+SpecialFolder]::UserProfile))" ".nuget\packages" |
| public class EncryptingJsonConverter : JsonConverter { | |
| private readonly byte[] _encryptionKeyBytes; | |
| public EncryptingJsonConverter(string encryptionKey) { | |
| if (encryptionKey == null) { | |
| throw new ArgumentNullException(nameof(encryptionKey)); | |
| } | |
| // Hash the key to ensure it is exactly 256 bits long, as required by AES-256 | |
| using (var sha = new SHA256Managed()) { |
| public class FormatKbSizeConverter : IValueConverter { | |
| [DllImport("shlwapi.dll", CharSet = CharSet.Unicode)] | |
| private static extern long StrFormatByteSizeW(long qdw, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszBuf, | |
| int cchBuf); | |
| public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { | |
| var number = System.Convert.ToInt64(value); | |
| var sb = new StringBuilder(32); | |
| StrFormatByteSizeW(number, sb, sb.Capacity); | |
| return sb.ToString(); |
| function UpdateVcxprojFile($filename) { | |
| $content = [xml](Get-Content -Path $filename) | |
| $changed = $false | |
| $toolsVersion = $content.Project.ToolsVersion | |
| if ($toolsVersion -ne "12.0") { | |
| $content.Project.ToolsVersion = "12.0" | |
| $changed = $true | |
| } | |
| using System.Diagnostics; | |
| using Raven.Client.Embedded; | |
| using Raven.Client.Listeners; | |
| using Raven.Json.Linq; | |
| namespace StackOverflow20764813 { | |
| internal class Program { | |
| private static void Main() { | |
| using (var store = new EmbeddableDocumentStore { RunInMemory = true }) { | |
| store.RegisterListener(new TestDocumentStoreListener()); |
| [TestFixture] | |
| public class UshortRegexTest { | |
| readonly Regex _ushortRegex = new Regex(@"^( | |
| 0 # 0 | |
| | | |
| [1-9]\d{0,3} # 1-9999 | |
| | | |
| [1-5]\d{4} # 10000-59999 | |
| | | |
| 6[0-4]\d\d\d # 60000-64999 |