Skip to content

Instantly share code, notes, and snippets.

View richardprice's full-sized avatar

Richard Price richardprice

View GitHub Profile
using System;
using System.Reflection;
using CommonDomain;
using CommonDomain.Core;
using CommonDomain.Persistence;
using CommonDomain.Persistence.EventStore;
using EventStore;
using EventStore.Dispatcher;
class window.Bus
constructor: ->
@dispatcher = {}
subscribe: (pattern, handler) ->
handlers = @dispatcher[pattern] || []
handlers.push handler
@dispatcher[pattern] = handlers
publish: (e) ->
@richardprice
richardprice / gulpfile.js
Last active August 29, 2015 14:09 — forked from hyrmn/gulpfile.js
var gulp = require('gulp'),
gulpif = require('gulp-if'),
less = require('gulp-less'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
rename = require('gulp-rename'),
clean = require('gulp-clean'),
runSequence = require('run-sequence'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
cinst 1password
cinst 7zip
cinst 7zip.install
cinst AdobeAIR
cinst adobereader
cinst Atom
cinst markdownpad2
var gulp = require('gulp');
var browserify = require('browserify');
var source = require("vinyl-source-stream");
var babelify = require("babelify");
var watchify = require('watchify');
var gutil = require('gulp-util');
var browserSync = require('browser-sync');
var historyApiFallback = require('connect-history-api-fallback')
var opts = {
<template>
<div class="input-group date">
<input type="text" value.bind="value" class="form-control"><span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
</div>
</template>
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Net;
namespace EventStoreService
{
public class EventStoreService
{
@richardprice
richardprice / cacheimplementation.cs
Last active September 2, 2015 18:59 — forked from jchannon/cacheimplementation.cs
Nancy caching using Last-Modified/If-Modified-Since header
public class Cache : ICache
{
private ConcurrentDictionary<string, DateTime> cacheLookup = new ConcurrentDictionary<string,DateTime>();
public Response Get(NancyContext ctx)
{
DateTime lastmodified;
if(ctx.Request.Method == "GET") //Could be POST as well I guess
{
@model SimpleAuthNinjectExample.Models.AuthenticateCallbackViewModel
<h1>AuthenticateCallback</h1>
@if (Model.Exception != null)
{
<h2>Error Information</h2>
<p>>Message: @Model.Exception.Message<br />
</p>
<p>StackTrace: @Model.Exception.StackTrace</p>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace SimpleAuthNinjectExample.Models
{
public class IndexViewModel
{
public string ErrorMessage { get; set; }