Skip to content

Instantly share code, notes, and snippets.

View trbngr's full-sized avatar

Chris Martin trbngr

  • Phoenix, AZ, USA
View GitHub Profile
using System;
using System.Linq;
using System.Threading.Tasks;
using System.Web.Http;
using SignalR.Client;
using SignalR.Client.Hubs;
using SignalR.Hubs;
namespace EventDay.Web.Api.Controllers
@trbngr
trbngr / EventStoreService.cs
Last active July 4, 2017 21:29
EventStore as a windows service w/ TopShelf
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Net;
namespace EventStoreService
{
public class EventStoreService
{
EventStoreConnection connection = get your connection;
string streamName = GetStreamName(aggregate);
//try to read the slice
var slice = connection.ReadStreamEventsForward(streamName, 0, int.MaxValue, false);
if (slice.Status == SliceReadStatus.StreamNotFound)
{
//create the stream if doesn't exist.
//NOTE: isJson MUST be true for this to work.
using System;
namespace ConsoleApplication2
{
internal class Program
{
private static void Main()
{
var bar = UniversalFactory.Create<Bar>(23);
Console.Out.WriteLine(bar);
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<packageSources>
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="eventday" value="http://www.myget.org/f/aspnetwebstacknightly/" />
</packageSources>
</configuration>
@trbngr
trbngr / Account.cs
Created July 9, 2015 00:30
Mini Akka Helper DSL
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
var express = require('express');
var session = require('express-session');
var RedisStore = require('connect-redis')(session);
var Strategy = require('./passport-openidconnect/index').Strategy;
module.exports.configure = function configure(app, passport) {
var identityServer = 'https://users.xxx.com/identity';
var auth = {
import { GraphQLScalarType } from 'graphql';
import { GraphQLError } from 'graphql/error';
import { Kind } from 'graphql/language';
import moment from 'moment';
import tz from 'moment-timezone';
function coerceDate(value) {
if(typeof value === 'string')
value = moment(value);
@trbngr
trbngr / SubscriptionRoot.js
Last active July 22, 2016 19:06
My root component for a relay-subscriptions application.
import React, {Component, PropTypes} from 'react';
import {SubscriptionProvider} from 'relay-subscriptions'
import uuid from 'uuid'
const outgoing = {
subscribe: 'subscribe',
ping: 'ping'
};
const incoming = {
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="akka" type="Akka.Configuration.Hocon.AkkaConfigurationSection, Akka" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<akka>