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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
typeof (DateTime) | |
.GetField("MaxValue") | |
.SetValue(DateTime.MaxValue, new DateTime(2012, 12, 21)); | |
var endOfWorld = DateTime.MaxValue; | |
} |
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
[user] | |
name = Brad Wilson | |
email = [email protected] | |
[alias] | |
amend = commit --amend | |
bl = blame -w -M -C | |
br = branch | |
cat = cat-file -t | |
co = checkout | |
df = diff --word-diff |
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
while (_isRunning) | |
{ | |
try | |
{ | |
if (channel == null || consumer == null) | |
{ | |
try | |
{ | |
_connection = factory.CreateConnection(); | |
channel = _connection.CreateModel(); |
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 class Demo : NancyModule | |
{ | |
public Demo(MyDependency dependency) | |
{ | |
Get["/{name}"] = parameters => { | |
return dependency.GetMessage(parameters.name); | |
}; | |
} | |
} |
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 CsQuery; | |
using Nancy; | |
using Nancy.Testing; | |
using Should; | |
using Xunit; | |
public class UserModuleTest | |
{ | |
[Fact] | |
public void WhenUserNotFound() |
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 System; | |
using System.Collections.Generic; | |
using System.Dynamic; | |
using System.Globalization; | |
using System.Linq; | |
using System.Reflection; | |
using System.Web; | |
using System.Web.ModelBinding; | |
namespace VS11BetaTAPWebForms |
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 System; | |
using System.Collections.Generic; | |
using System.Dynamic; | |
using System.Globalization; | |
using System.Linq; | |
using System.Reflection; | |
using System.Web; | |
using System.Web.ModelBinding; | |
namespace VS11BetaTAPWebForms |
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 class SiteScrape : HttpTaskAsyncHandler | |
{ | |
public override async Task ProcessRequestAsync(HttpContext context) | |
{ | |
using (var http = new HttpClient()) | |
{ | |
var downloadTasks = new List<Task<string>> { | |
http.GetStringAsync("http://bing.com"), | |
http.GetStringAsync("http://google.com"), | |
http.GetStringAsync("http://oredev.org"), |
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 HttpErrorExtensions | |
{ | |
public static ModelStateDictionary GetModelState(this HttpError httpError) | |
{ | |
Ensure.Argument.NotNull(httpError, "httpError"); | |
object serialized; | |
if (httpError.TryGetValue("ModelState", out serialized)) | |
{ | |
var modelState = new ModelStateDictionary(); |
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 HttpErrorExtensions | |
{ | |
public static ModelStateDictionary GetModelState(this HttpError httpError) | |
{ | |
Ensure.Argument.NotNull(httpError, "httpError"); | |
object serialized; | |
if (httpError.TryGetValue("ModelState", out serialized)) | |
{ | |
var modelState = new ModelStateDictionary(); |