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
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 |
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
// 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; |
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
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() |
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
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) |
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
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); |
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 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); |
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
once = (func) -> | |
calls = 0 | |
-> | |
calls+=1 | |
if (calls > 1) | |
throw "baad girl" | |
func.apply(this, arguments) | |
m = once -> alert "hello" |
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
<h2>Create</h2> | |
@{ Html.RenderPartial("form"); } |
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
private void CreateSchema() | |
{ | |
using (var sqlConnection = new SqlConnection(connectionString)) | |
{ | |
sqlConnection.Open(); | |
using (var tx = sqlConnection.BeginTransaction()) | |
{ | |
foreach(var dto in dtos) | |
{ | |
try |
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
waitForAjaxRequestsToComplete = (callback, functions) -> | |
successes = 0 | |
failures = 0 | |
failedCalls = [] | |
$(functions).each (index, item) -> | |
item.done -> | |
successes += 1 | |
item.fail -> | |
failures += 1 | |
failedCalls.push item |
OlderNewer