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
using ServiceStack.Text; | |
public class DynamicJson : DynamicObject | |
{ | |
private readonly IDictionary<string, object> _hash = new Dictionary<string, object>(); | |
public static string Serialize(dynamic instance) | |
{ | |
var json = JsonSerializer.SerializeToString(instance); | |
return json; |
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 class XmlFormatter : MediaTypeFormatter | |
{ | |
private static readonly IDictionary<Type, XmlSerializer> Cache; | |
private static readonly XmlSerializerNamespaces IgnoreNamespaces; | |
static XmlFormatter() | |
{ | |
Cache = new Dictionary<Type, XmlSerializer>(); | |
IgnoreNamespaces = new XmlSerializerNamespaces(); | |
IgnoreNamespaces.Add("", ""); |
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
using System.Collections.Generic; | |
public class BubbleSort | |
{ | |
public void Sort<T>(IList<T> items) | |
{ | |
var due = true; | |
while(due) | |
{ | |
due = false; |
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
using System.Collections.Generic; | |
public class InsertionSort | |
{ | |
public void Sort<T>(IList<T> items) | |
{ | |
for (var i = 1; i < items.Count; i++) | |
{ | |
int j; | |
var left = items[i]; |
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
using System; | |
using System.Security.Cryptography; | |
using System.Text; | |
namespace Aes | |
{ | |
static class Program | |
{ | |
static void Main() | |
{ |
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
/// <summary> | |
/// Handles casing, as well as conventionally deserializes to any interfaces rather than the full type | |
/// License: https://opensource.org/licenses/MIT | |
/// </summary> | |
public class JsonContractResolver : DefaultContractResolver | |
{ | |
private readonly Case _case; | |
public enum Case | |
{ |
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
#region License | |
/* | |
NoContainer - Because, no. | |
-------------------------- | |
Copyright(c) 2016-2017 Daniel Crenna | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | |
documentation files (the "Software"), to deal in the Software without restriction, including without limitation | |
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and |
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
using System.Data; | |
using System.Data.Common; | |
using System.Data.SqlClient; | |
using System.Diagnostics; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.Extensions.Logging; | |
namespace DatabaseProfiling | |
{ |
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
using System.IO; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.PlatformAbstractions; | |
using Swashbuckle.AspNetCore.Swagger; | |
namespace SwaggerFeature | |
{ | |
public static class Add |
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
using System; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Reflection; | |
namespace DevOps | |
{ | |
public class GitTools | |
{ | |
public static string GetGitHash(string @namespace) |
OlderNewer