Skip to content

Instantly share code, notes, and snippets.

View Tigraine's full-sized avatar

Daniel Hoelbling-Inzko Tigraine

View GitHub Profile
@Tigraine
Tigraine / devise.de.yml
Created March 23, 2012 11:42 — forked from chrugail/devise.de.yml
german i18n for devise
de:
errors:
messages:
not_found: "nicht gefunden"
already_confirmed: "wurde bereits bestätigt"
not_locked: "ist nicht gesperrt"
devise:
failure:
unauthenticated: 'Sie müssen sich anmelden oder registrieren, bevor Sie fortfahren können.'
@Tigraine
Tigraine / content.less
Created February 9, 2012 10:09
dotless import problem
@import "mixins.less";
.content
{
border: 3px solid red;
.curves(4px);
}
@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
@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 / Thisworks.cshtml
Created May 30, 2011 12:17
Razor weirdness
<h2>Create</h2>
@{ Html.RenderPartial("form"); }
@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"
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);
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);
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)
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()