Skip to content

Instantly share code, notes, and snippets.

View hagbarddenstore's full-sized avatar

Kim Johansson hagbarddenstore

View GitHub Profile
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
public class Program
{
public static void Main()
{
namespace Company.ExampleApp
{
using System;
public class Program
{
public static void Main(string[] arguments)
{
var router = new Router();
namespace Company.HttpServer
{
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Net;
using System.Threading;
public class Server
{
namespace Company
{
using System;
public abstract class Handler
{
public static implicit operator Handler(Action<ResponseWriter, Request> handler)
{
return new HandlerWrapper(handler);
}
@hagbarddenstore
hagbarddenstore / Books.txt
Last active September 12, 2020 09:34
A collection of computer science related books I've read throughout the years.
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
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)
{
public static class Program
{
private static readonly AutoResetEvent _event = new AutoResetEvent();
public static void Main()
{
Console.CancelKeyPress += (sender, arguments) =>
{
Console.WriteLine("Exiting...");
using System;
using System.Linq;
using Dapper;
using Npgsql;
public class Program
{
public static void Main()
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);
}
@hagbarddenstore
hagbarddenstore / FindAmazonMachineImages.cs
Created November 13, 2014 13:55
Application to list different machines images in different regions. Used to keep an updated list of AMI ids.
/**
* Install dependencies via NuGet: Install-Package AWSSDK
*/
namespace FindAmazonMachineImages
{
using System;
using System.Collections.Generic;
using System.Linq;