Skip to content

Instantly share code, notes, and snippets.

View bryanhunter's full-sized avatar

Bryan Hunter bryanhunter

View GitHub Profile
@bryanhunter
bryanhunter / CastleCommandHandlerDemo.cs
Created February 7, 2012 16:42
Commands sent to a CommandRouter get routed to the appropriate CommandHandler (using Castle.Windsor)
using System;
using Castle.MicroKernel.Registration;
using Castle.Windsor;
namespace CollectionResolverForGenericInterface
{
internal class Program
{
private static void Main(string[] args)
{
@bryanhunter
bryanhunter / build-erlang-r15b.sh
Created January 12, 2012 20:52
Build Erlang R15B on a fresh Ubuntu box (tested on Ubuntu 11.10)
#!/bin/bash
# Pull this file dowm, make it executable and run it with sudo
# wget https://raw.github.com/gist/1603037/build-erlang-r15b.sh
# chmod u+x build-erlang-r15b.sh
# sudo ./build-erlang-r15b.sh
if [ $(id -u) != "0" ]; then
echo "You must be the superuser to run this script" >&2
exit 1
fi
@bryanhunter
bryanhunter / build-erlang-r14b04.sh
Created December 1, 2011 17:14
Script to build Erlang 14B04 (tested on a fresh Ubuntu 11.10 install)
#!/bin/bash
# Pull this file dowm, make it executable and run it with sudo
# wget https://raw.github.com/gist/1418287/build-erlang-r14b04.sh
# chmod u+x build-erlang-r14b04.sh
# sudo ./build-erlang-r14b04.sh
if [ $(id -u) != "0" ]; then
echo "You must be the superuser to run this script" >&2
exit 1
fi
@bryanhunter
bryanhunter / HashCode.cs
Created October 20, 2011 16:25
Get hash code
public static class HashCode
{
public static string Of(string content)
{
var buffer = Encoding.UTF8.GetBytes(content);
var sha1 = new SHA1CryptoServiceProvider();
var hash = BitConverter.ToString(sha1.ComputeHash(buffer)).Replace("-", "");
return hash;
}
}
@bryanhunter
bryanhunter / gist:1256193
Created October 1, 2011 15:34
Session "Bringing Erlang into your C# Shop: a How-to"

OK... you've heard the Erlang success stories, you know the sweet spots, and you're convinced that Erlang is for you. Where does that leave you as a C# developer? In a pretty good spot actually. A team of C# and Erlang developers is a force to be reckoned with because Erlang and .NET are complements--each is lousy at what the other is exceptional at. Realizing this can save you and your company a lot of time, money and headaches. Many C# developers write both JavaScript and SQL scripts; adding Erlang to the mix should be just as natural. So how is it done? What are the best interop strategies? What are the development tools? Can it all be done on Windows? How about unit testing and deployment? What are the risks? How can they be avoided?

@bryanhunter
bryanhunter / gist:1256191
Created October 1, 2011 15:33
Session "Erlang: An Intro for C# Developers"

Would you like to build massively parallel, distributed, fault-tolerant, cross-platform, easily maintainable systems with less code and look cool doing it? If so, the opensource programming language Erlang has some real sweet spots for you. If you're unfamiliar with Erlang you may be surprised to learn how battle tested it is: Facebook's chat backend, CouchDB, RabbitMQ, GitHub's backend and Amazon's SimpleDB are all written in Erlang, and every phone call you make is likely helped along by some Erlang somewhere. So how does a functional programming language with Prolog and telecom roots solve so many of the big problems that Enterprisey languages famously stink at? What's so darn special about Erlang? What are the pieces and the tools? What does it look like? How do I (as a C# developer) even get started with Erlang?

@bryanhunter
bryanhunter / gist:1256187
Created October 1, 2011 15:31
Session "Windows Metro + CQRS + Erlang: antiheroes FTW!"

Three anti-hero technologies (Microsoft's new Windows 8 Metro tablets, the Command-Query Responsibility Separation architectural pattern, and the opensource functional programming language Erlang) snap together to form a delightful, maintainable and scalable system. It's not a mainstream or obvious choice, but I'll show you in an opensource end-to-end application how they fit. This will be my technology stack of choice for years to come, and I look forward to showing you why.

@bryanhunter
bryanhunter / bryanhunter-bio.md
Created October 1, 2011 15:30
Bryan Hunter's speaker bio

Bryan Hunter is a geek, a founding partner of Firefly Logic and the president of the Nashville .NET User Group. Bryan is obsessed with Lean, functional programming (Erlang, C# and F#), CQRS and Caliburn.Micro. He has been speaking on each of these subjects tirelessly for years at meetups, bars, user groups, bars, regional conferences and bars. You can say hi to Bryan on Twitter (@bryan_hunter), read his blog at http://codeswamp.com, and see what Firefly Logic is all about here:http://fireflylogic.com

@bryanhunter
bryanhunter / .gitconfig
Created September 8, 2011 20:37
My .gitconfig file
[core]
autocrlf=true
editor = "emacs"
[user]
name = Bryan Hunter
[color]
status = auto
branch = auto
@bryanhunter
bryanhunter / .emacs
Created August 25, 2011 22:53
My ".emacs" file hooks in my custom Erlang rig settings
(add-to-list 'load-path "~/ErlangRigEmacsConfig")
(require 'my-config)