Skip to content

Instantly share code, notes, and snippets.

public class FailureResult : IResult
{
public bool Success => false;
public string ErrorMessage { get; }
public FailureResult(string errorMessage)
{
if (string.IsNullOrWhiteSpace(errorMessage))
{

NOTE: This does not work properly on newer versions of nodejs, will have a look at creating an up to date version.

If it does not work properly for you try doing this in a Docker container with an older version of node:

docker run node:0.10 /bin/bash

This works properly on Bash on Ubuntu on Windows because Ubuntu 14.04 has quite an old version of Node in the repositories.

sudo apt-get install nodejs-legacy npm
@jvandertil
jvandertil / gist:c4f3884e597bed2ab0f7
Created July 28, 2014 15:59
Select name of first element in soap body in wso2 esb with XPath
local-name($body/*)
@jvandertil
jvandertil / gist:8293053
Created January 7, 2014 01:13
docker ps -a without running containers
docker ps -a | grep Exit | cut -d ' ' -f 1
@jvandertil
jvandertil / BootstrapFubu.cs
Created December 31, 2013 17:02
Integration testing with FubuMVC and Katana This did not work.
// Using a separate class for bootstrapping makes it much easier to reuse your application
// in testing scenarios with either SelfHost or OWIN/Katana hosting
public class MyApplication : IApplicationSource
{
public FubuApplication BuildApplication()
{
// This is bootstrapping an application with all default FubuMVC conventions and
// policies pulling actions from only this assembly for classes suffixed with
// "Endpoint" or "Endpoints"
return FubuApplication.DefaultPolicies().StructureMap<MyStructureMapRegistry>();
@jvandertil
jvandertil / autogen.sh
Created December 5, 2013 20:29
ZFS build logs
jos@athena:~/zfs$ ./autogen.sh
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I config
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'.
libtoolize: copying file `config/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `config'.
libtoolize: copying file `config/libtool.m4'
@jvandertil
jvandertil / ConsoleReadMasked.cs
Last active December 21, 2015 00:38
Function to read input from the Console while masking the output. Useful for reading passwords.
/// <summary>
/// Reads the next line of characters from the standard input stream (Console).
/// Outputs a '*' character for each character read, instead of the actual character.
/// </summary>
/// <returns>The next line of characters from the input stream.</returns>
public static string ReadLineMasked()
{
var password = new StringBuilder();
ConsoleKeyInfo pressed;
@jvandertil
jvandertil / gist:4550276
Last active December 11, 2015 05:08
Shows optimistic concurrency at work for the Azure Tables implementation of JOliver's EventStore
using System;
using EventStore;
namespace EventStoreConcurrencyTest
{
class Program
{
static void Main(string[] args)
{
var eventStore1 = WireupEventStore();