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
var factory = new PackageRepositoryFactory(); | |
IPackageRepository repository = factory.CreateRepository("https://go.microsoft.com/fwlink/?LinkID=206669"); | |
foreach (var p in repository.GetPackages()) { | |
Console.WriteLine(p); | |
} |
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 Voting : Hub { | |
public void SubmitVote(int answerId) { | |
question.Answers.Single(x => x.AnswerId == answerId).NumVotes++; | |
Clients.update(question); | |
} | |
} |
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 Voting : Hub { | |
// Could load this from a DB | |
static Question question = new Question { | |
QuestionText = "What's your favourite upcoming technology?", | |
Answers = new List<Answer> { | |
new Answer { AnswerId = 1, AnswerText = "C# 5" }, | |
new Answer { AnswerId = 2, AnswerText = "WebSockets" }, | |
new Answer { AnswerId = 3, AnswerText = "Windows 8" }, | |
new Answer { AnswerId = 5, AnswerText = "Magic rainbow unicorns" }, | |
} |
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 static class FuncExtensions { | |
public static Func<TKey, TResult> Memoize<TKey, TResult>(this Func<TKey, TResult> f) { | |
return f.Memoize(EqualityComparer<TKey>.Default); | |
} | |
public static Func<TKey, TResult> Memoize<TKey, TResult>(this Func<TKey, TResult> f, IEqualityComparer<TKey> equalityComparer) { | |
var cache = new ConcurrentDictionary<TKey, Lazy<TResult>>(equalityComparer); | |
return key => { | |
var lazy = cache.GetOrAdd(key, new Lazy<TResult>(() => f(key))); | |
return lazy.Value; |
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
$ git -s status | |
Unknown option: -s | |
usage: git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path] | |
[-p|--paginate|--no-pager] [--no-replace-objects] | |
[--bare] [--git-dir=<path>] [--work-tree=<path>] | |
[-c name=value] [--help] | |
<command> [<args>] | |
$ git status -s | |
?? .gitignore |
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
/// <reference path="jquery-1.6.2.js" /> | |
(function (window) { | |
"use strict"; | |
if (typeof (window.signalR) !== "function") { | |
throw "SignalR: SignalR is not loaded. Please ensure SignalR.js is referenced before ~/signalr/hubs."; | |
} | |
var viewModels = {}; | |
var oldProcessState = window.signalR.hub.processState; |
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
<%@ Page Language="C#" Debug="true" %> | |
<% | |
var exePath = @"C:\Program Files (x86)\Git\bin\sh.exe"; | |
var working = @"C:\Program Files (x86)\Git\bin"; | |
var args = "-c ls"; | |
var psi = new System.Diagnostics.ProcessStartInfo { | |
FileName = exePath, | |
WorkingDirectory = working, |
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
/*! | |
* SignalR JavaScript Library v0.5 | |
* http://signalr.net/ | |
* | |
* Copyright David Fowler and Damian Edwards 2012 | |
* Licensed under the MIT. | |
* https://github.com/SignalR/SignalR/blob/master/LICENSE.md | |
*/ | |
/// <reference path="jquery-1.6.2.js" /> |
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
diff --git a/Imports/SignalR/SignalR.Client/Http/DefaultHttpClient.cs b/Imports/SignalR/SignalR.Client/Http/DefaultHttpClient.cs | |
index 345a30f..3999ed6 100644 | |
--- a/Imports/SignalR/SignalR.Client/Http/DefaultHttpClient.cs | |
+++ b/Imports/SignalR/SignalR.Client/Http/DefaultHttpClient.cs | |
@@ -17,8 +17,12 @@ public class DefaultHttpClient : IHttpClient | |
/// <returns>A <see cref="Task{IResponse}"/>.</returns> | |
public Task<IResponse> GetAsync(string url, Action<IRequest> prepareRequest) | |
{ | |
- return HttpHelper.GetAsync(url, request => prepareRequest(new HttpWebRequestWrapper(request))) | |
- .Then(response => (IResponse)new HttpWebResponseWrapper(response)); |
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
@echo off | |
:: Specify project file | |
IF "%PROJECT%" == "" ( | |
SET PROJECT=PROJECTFILEGOESHERE | |
) | |
IF "%PROJECT%" == "PROJECTFILEGOESHERE" goto MissingProject | |
:: Specify project configuration |