Skip to content

Instantly share code, notes, and snippets.

View Tigraine's full-sized avatar

Daniel Hoelbling-Inzko Tigraine

View GitHub Profile
set-option -g default-shell /usr/local/bin/zsh
set -g prefix C-a
bind-key C-a last-window
bind-key v split-window -v
setw -g monitor-activity on
set-window-option -g window-status-current-bg white
setw -g mode-keys vi
set -g mode-mouse on
set-window-option -g utf8 on
// If you are faced with a stupid library swallowing callback exceptions this
// function will still report the exception details to you.
function exposeException(fn) {
return function () {
try {
return fn.apply(this, arguments);
} catch (e) {
console.log("Exception occured", e);
throw e;
WPF Client App:
public partial class App : Application
{
public static IBus Bus { get; set; }
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
Bus = Configure.With()
.Log4Net()
Castle.MicroKernel.ComponentActivator.ComponentActivatorException was unhandled
Message=Error setting property set_MessageTypes on type NServiceBus.Serializers.XML.MessageSerializer, Component id is NServiceBus.Serializers.XML.MessageSerializer. See inner exception for more information.
Source=Castle.MicroKernel
StackTrace:
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.SetUpProperties(Object instance, CreationContext context)
at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext context)
at Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext context)
at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext context)
at Castle.MicroKernel.Lifestyle.SingletonLifestyleManager.Resolve(CreationContext context)
at Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean track)
A Message gets handled through NSB and the following code is run:
public void Handle(UpdateProductData message)
{
var product = session.Get<Product>(message.ProductDto.Id);
product.Name = message.ProductDto.Name;
product.PartNumber = message.ProductDto.PartNumber;
product.Price = message.ProductDto.Price;
session.Update(product);
Logger.InfoFormat("Updated Product {0}", product.Id);
public class MultiResourceWrapper : DynamicObject
{
private readonly Dictionary<string, object> resources = new Dictionary<string, object>();
public MultiResourceWrapper()
{
var assemblyNamespace = this.GetType().Assembly.GetManifestResourceNames();
foreach (var s in assemblyNamespace)
{
var manager = new ResourceManager(ExtractResourceFullName(s), GetType().Assembly);
var name = ExtractResourceName(s);
@Tigraine
Tigraine / once.coffee
Created May 22, 2011 20:53
Once function in JS
once = (func) ->
calls = 0
->
calls+=1
if (calls > 1)
throw "baad girl"
func.apply(this, arguments)
m = once -> alert "hello"
@Tigraine
Tigraine / Thisworks.cshtml
Created May 30, 2011 12:17
Razor weirdness
<h2>Create</h2>
@{ Html.RenderPartial("form"); }
@Tigraine
Tigraine / gist:1089096
Created July 18, 2011 10:12
Arrow-Head anti-pattern in perfection..
private void CreateSchema()
{
using (var sqlConnection = new SqlConnection(connectionString))
{
sqlConnection.Open();
using (var tx = sqlConnection.BeginTransaction())
{
foreach(var dto in dtos)
{
try
@Tigraine
Tigraine / wait.coffee
Created September 26, 2011 12:11
wait for multiple ajax requests to finish
waitForAjaxRequestsToComplete = (callback, functions) ->
successes = 0
failures = 0
failedCalls = []
$(functions).each (index, item) ->
item.done ->
successes += 1
item.fail ->
failures += 1
failedCalls.push item