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
static async Task<string> DownloadAllAsync(IEnumerable<string> locations) | |
{ | |
var client = new HttpClient(); | |
var downloads = locations.Select(client.GetStringAsync); | |
var downloadTasks = downloads.ToArray(); | |
var pages = await Task.WhenAll(downloadTasks); | |
return string.Concat(pages); | |
} |
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
private static async Task<string> DownloadStringWithRetries(string location) | |
{ | |
using (var client = new HttpClient()) | |
{ | |
var nextDelay = TimeSpan.FromSeconds(1); | |
for (int i = 0; i != 3; i++) | |
{ | |
try | |
{ | |
Console.WriteLine("trying to download {0}.", location); |
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
private static async Task<string> DownloadStringWithTimeout(string location) | |
{ | |
using (var client = new HttpClient()) | |
{ | |
var downloadTask = client.GetStringAsync(location); | |
var timeoutTask = Task.Delay(TimeSpan.FromSeconds(3)); | |
var completedTask = await Task.WhenAny(downloadTask, timeoutTask); | |
if (completedTask == timeoutTask) |
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
USE [Medium] | |
GO | |
DELETE FROM [Post_Tag_Junction] | |
DELETE FROM [Posts] | |
DELETE FROM [Tags] | |
INSERT INTO [Tags] | |
VALUES |
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 AddPostCommandHandler : IRequestHandler<AddPostCommand, string> | |
{ | |
public string Handle(AddPostCommand command) | |
{ | |
var param = new | |
{ | |
PublishDate = DateTime.Now, | |
Slug = SlugConverter.Convert(command.Title), | |
command.Title, | |
command.Body, |
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 ActionResult AddPost(PostCommand command) | |
{ | |
var response = mediator.Send(command); | |
if (response.Success) { | |
return RedirectToAction("Index", "Post", new { slug = response.Data.Slug }); | |
} | |
ModelState.AddModelError("", response.Message) | |
return View(command); | |
} |
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
Capability Red - Requirements at Scale by Liz Keogh | |
http://www.ndcvideos.com/#/app/video/2111 | |
---- | |
Beyond Rectangles in Web Design - CSS Shapes and CSS Masking by Razvan Caliman | |
http://www.ndcvideos.com/#/app/video/2121 | |
---- | |
Coding Culture by Sven Peters | |
http://www.ndcvideos.com/#/app/video/2131 | |
---- | |
The Ultimate Logging Architecture - You KNOW You Want It by Michele Leroux Bustamante |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// The message you want to send accross the network | |
var outboundMessage = new ChatMessage { Body = "Hello" }; | |
// Serialize the outbound message | |
byte[] outboundMessageData; |
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.Configuration; | |
using System.Data.SqlClient; | |
using System.Data.SqlTypes; | |
using System.IO; | |
using System.Security.Cryptography; | |
namespace Uhu | |
{ | |
public class Program |