Skip to content

Instantly share code, notes, and snippets.

View MrClyfar's full-sized avatar

Jason Evans MrClyfar

View GitHub Profile
<UserSettings>
<ApplicationIdentity version="15.0"/>
<ToolsOptions>
<ToolsOptionsCategory name="Environment" RegisteredName="Environment"/>
</ToolsOptions>
<Category name="Environment_Group" RegisteredName="Environment_Group">
<Category name="Environment_FontsAndColors" Category="{1EDA5DD4-927A-43a7-810E-7FD247D0DA1D}" Package="{DA9FB551-C724-11d0-AE1F-00A0C90FFFC3}" RegisteredName="Environment_FontsAndColors" PackageName="Visual Studio Environment Package">
<PropertyValue name="Version">2</PropertyValue>
<FontsAndColors Version="2.0">
<Theme Id="{A4D6A176-B948-4B29-8C66-53C97A1ED7D0}"/>
windbg ANSI Command Tree 1.0
title {“Common Commands”}
body
{“Common Commands”}
{“Information”}
{“Time of dump”} {“.time”}
{“Process being debugged”} {“|”}
{“Dump Location”} {“||”}
{“Create server on port 9999”} {“.server tcp:port=9999”}
{“Show remote connections”} {“.clients”}
@MrClyfar
MrClyfar / gist:4855352fb43506bdf406
Created May 29, 2015 07:29
C# Inherited variable loses value repro attempt
namespace ConsoleApplication1
{
public class BaseClass
{
protected string message;
public string Message
{
get { return message; }
}
@MrClyfar
MrClyfar / gist:fa824c542e5a7aba9bc0
Last active August 29, 2015 14:16
Trace listener that writes to web page.
public class CustomTraceListener : TraceListener
{
public override void Write(string message)
{
}
public override void WriteLine(string message)
{
[HttpPost]
public ActionResult Index(HomeIndexViewModel viewModel)
{
ModelState.Remove("Number");
viewModel.Number = viewModel.Number + 1;
return View(viewModel);
}
@model FormValuesCached.Controllers.HomeIndexViewModel
@using (Html.BeginForm())
{
<input type="text" id="number" name="number" value="@(Model.Number)" />
<input type="submit" value="Click Me"/>
}
@model FormValuesCached.Controllers.HomeIndexViewModel
@using (Html.BeginForm())
{
@Html.TextBoxFor(m => m.Number)
<input type="submit" value="Click Me"/>
}
public class HomeController : Controller
{
public ActionResult Index()
{
return View(new HomeIndexViewModel());
}
[HttpPost]
public ActionResult Index(HomeIndexViewModel viewModel)
{
public class Program
{
private static void Main(string[] args)
{
var words = GetWordCount(new SimpleCharacterReader());
foreach (var word in words)
Console.WriteLine(word.Key + " " + word.Value);
}
@MrClyfar
MrClyfar / Regex Example
Created August 24, 2013 20:22
Very basic example of using a regex to find a substring, and display that substring's starting index and length.
namespace ConsoleApplication1
{
using System;
using System.Text.RegularExpressions;
class Program
{
static void Main(string[] args)
{
var reg = Regex.Match("xyz This is just what i want.", "xyz");