This file contains hidden or 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 string PrettyPrintXml(this string xml) | |
| { | |
| using (var stream = new MemoryStream()) | |
| using (var writer = new XmlTextWriter(stream, Encoding.Unicode)) | |
| { | |
| var document = new XmlDocument(); | |
| // Load the XmlDocument with the XML. | |
| document.LoadXml(xml); | |
| writer.Formatting = Formatting.Indented; |
This file contains hidden or 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
| async Task Main() | |
| { | |
| var checkoutQueue = new System.Collections.Concurrent.BlockingCollection<string>(new ConcurrentQueue<string>()); | |
| var searchQueue = new System.Collections.Concurrent.BlockingCollection<string>(new ConcurrentQueue<string>()); | |
| var queues = new | |
| { | |
| Checkout = checkoutQueue, | |
| Search = searchQueue | |
| }; |
This file contains hidden or 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
| $env:MSBuildEmitSolution=1 | |
| msbuild FooBar.sln /t:ValidateSolutionConfiguration | |
| $env:MSBuildEmitSolution=0 |
This file contains hidden or 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
| # http://stackoverflow.com/a/10472358/2607840 | |
| Function Get-ProjectReferences ($rootFolder) | |
| { | |
| $projectFiles = Get-ChildItem $rootFolder -Filter *.csproj -Recurse | |
| $ns = @{ defaultNamespace = "http://schemas.microsoft.com/developer/msbuild/2003" } | |
| $projectFiles | ForEach-Object { | |
| $projectFile = $_ | Select-Object -ExpandProperty FullName | |
| $projectName = $_ | Select-Object -ExpandProperty BaseName | |
| $projectXml = [xml](Get-Content $projectFile) |
This file contains hidden or 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 Base32 | |
| { | |
| public static byte[] ToBytes(string input) | |
| { | |
| if (string.IsNullOrEmpty(input)) | |
| { | |
| throw new ArgumentNullException("input"); | |
| } | |
| input = input.TrimEnd('='); //remove padding characters |
This file contains hidden or 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
| using Newtonsoft.Json; | |
| /// <summary> | |
| /// This is a slightly modified C# implementation of the JSON API format. | |
| /// Documentation is available here: http://jsonapi.org/format/ | |
| /// </summary> | |
| public class JsonResult | |
| { | |
| /// <summary> |
This file contains hidden or 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
| var weights = new [] { | |
| new {Desc = "A", Weight = 40}, | |
| new {Desc = "B", Weight = 25}, | |
| new {Desc = "B1", Weight = 20}, | |
| new {Desc = "C", Weight = 3}, | |
| new {Desc = "D", Weight = 1}, | |
| new {Desc = "E", Weight = 1}, | |
| new {Desc = "F", Weight = 10} | |
| }; |
This file contains hidden or 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
| #add 'node_modules' to .gitignore file | |
| git rm -r --cached node_modules | |
| git commit -m 'Remove the now ignored directory node_modules' | |
| git push origin master |
This file contains hidden or 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
| using Org.BouncyCastle.Crypto; | |
| using Org.BouncyCastle.Crypto.Parameters; | |
| using Org.BouncyCastle.OpenSsl; | |
| using Org.BouncyCastle.Security; | |
| using System; | |
| using System.IO; | |
| using System.Security.Cryptography; | |
| namespace MyProject.Data.Encryption | |
| { |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Corgi Error Pages</title> | |
| <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Outfit:wght@300;500;700&display=swap" rel="stylesheet"> | |
| <style> | |
| * { margin: 0; padding: 0; box-sizing: border-box; } | |
| body { background: #0a0a0f; font-family: Outfit, sans-serif; color: #e8eaed; } |