yUML is a simple tool for embedding UML diagrams in wikis and blogs without needing any UML or diagramming tools.
Here's an idea of how it could be used in your repository readme.markdown or wiki.
View the RAW source to see how images are made.
using System; | |
using Newtonsoft.Json; | |
namespace JsonConverters | |
{ | |
/// <summary> | |
/// Handles converting JSON string values into a C# boolean data type. | |
/// </summary> | |
public class BooleanJsonConverter : JsonConverter | |
{ |
public class ConsoleRequestLogger : DelegatingHandler | |
{ | |
protected async override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) | |
{ | |
Console.ForegroundColor = ConsoleColor.Cyan; | |
Console.WriteLine("> {0} {1}",request.Method,request.RequestUri.GetComponents(UriComponents.PathAndQuery, UriFormat.SafeUnescaped)); | |
ProcessHeader(request.Headers, (name, value) => Console.WriteLine("> {0}: {1}", name, value)); | |
if (request.Content != null) | |
{ |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var server = WebApp.Start("http://localhost:1002/", (app) => | |
{ | |
var config = new HttpConfiguration(); | |
config.MapHttpAttributeRoutes(); | |
config.Services.Replace(typeof(IExceptionHandler), new RethrowExceptionHandler()); |
using System; | |
using System.Text; | |
using System.Xml; | |
using System.Xml.Linq; | |
static string PrettyXml(string xml) | |
{ | |
var stringBuilder = new StringBuilder(); | |
var element = XElement.Parse(xml); |
using System; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Runtime.Serialization.Json; | |
using System.ServiceModel; | |
using System.ServiceModel.Channels; | |
using System.ServiceModel.Description; | |
using System.ServiceModel.Dispatcher; | |
using System.Text; | |
using System.Threading; |
yUML is a simple tool for embedding UML diagrams in wikis and blogs without needing any UML or diagramming tools.
Here's an idea of how it could be used in your repository readme.markdown or wiki.
View the RAW source to see how images are made.
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)] | |
public class RequiredIfEmptyAttribute : ValidationAttribute, IClientValidatable | |
{ | |
private readonly string[] _dependentProperties; | |
public RequiredIfEmptyAttribute(params string[] dependentPropertieses) | |
{ | |
_dependentProperties = dependentPropertieses; | |
} |
// Usage: | |
// [AttributeUsage("Option1", "Option2", "Option3")] | |
// public string MyTestAttribute { get; set; } | |
// | |
// In view: | |
// @Html.DropDownListFor(x => x.MyTestAttribute) | |
// | |
// Result: | |
// Dropdown list with 3 options. |
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] | |
public class DateComparerAttribute : ValidationAttribute, IClientValidatable | |
{ | |
/// <summary> | |
/// If set will use DateTime.AddDays to specify the Min Valid Date | |
/// </summary> | |
public double MinDateAddDaysFromNow | |
{ | |
get { return _minDateAddDaysFromNow; } | |
set |
/// ASP.NET MVC 3 Credit Card Validator Attribute | |
/// by Ben Cull - 4 November 2010 | |
/// | |
/// With special thanks to: | |
/// Thomas @ Orb of Knowledge - http://orb-of-knowledge.blogspot.com/2009/08/extremely-fast-luhn-function-for-c.html | |
/// For the Extremely fast Luhn algorithm implementation | |
/// | |
/// And Paul Ingles - http://www.codeproject.com/KB/validation/creditcardvalidator.aspx | |
/// For a timeless blog post on credit card validation |