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.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Reflection; | |
public class Program | |
{ | |
public static void Main() | |
{ |
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
namespace Company.ExampleApp | |
{ | |
using System; | |
public class Program | |
{ | |
public static void Main(string[] arguments) | |
{ | |
var router = new Router(); |
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
namespace Company.HttpServer | |
{ | |
using System; | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.Net; | |
using System.Threading; | |
public class Server | |
{ |
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
namespace Company | |
{ | |
using System; | |
public abstract class Handler | |
{ | |
public static implicit operator Handler(Action<ResponseWriter, Request> handler) | |
{ | |
return new HandlerWrapper(handler); | |
} |
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
Clean Code: A handbook of agile software craftmanship | |
ISBN-13: 978-0132350884 | |
The Clean Coder: A code of conduct for professional programmers | |
ISBN-13: 978-0137081073 | |
Domain-Driven Design: Tackling complexity in the heart of software | |
ISBN-13: 978-0321125217 | |
Patterns of Enterprise Application Architecture |
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 void insertWords(List<string> words) | |
{ | |
var context = new OperationDataContext(); | |
var existingWords = context.GetTable<english_dictionary>().Where(word => words.Contains(word)).ToList(); | |
var wordsToInsert = words.Except(existingWords).ToList(); | |
foreach (var word in wordsToInsert) | |
{ |
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 Program | |
{ | |
private static readonly AutoResetEvent _event = new AutoResetEvent(); | |
public static void Main() | |
{ | |
Console.CancelKeyPress += (sender, arguments) => | |
{ | |
Console.WriteLine("Exiting..."); |
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.Linq; | |
using Dapper; | |
using Npgsql; | |
public class Program | |
{ | |
public static void Main() |
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
void Main() | |
{ | |
var a = Bind(new Dog(), x => x.Hello()); | |
a(); | |
var b = Bind<Dog, int>(new Dog(), (x, arg1) => x.Eat(arg1)); | |
b(3); | |
} |
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
/** | |
* Install dependencies via NuGet: Install-Package AWSSDK | |
*/ | |
namespace FindAmazonMachineImages | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; |