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 static class ExtendImmutableEnvelope | |
{ | |
public static Guid GetGuid(this ImmutableEnvelope envelope, string key) | |
{ | |
return Get(envelope, key, s => | |
{ | |
Guid result; | |
return Guid.TryParse(s, out result) == false ? Guid.Empty : result; | |
}); | |
} |
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 Program | |
{ | |
private static void Main() | |
{ | |
var instance = new SomeClass | |
{ | |
SomePropertyWithAttribute = "I have an attribute", | |
SomeProperty = "I don't have an attribute" | |
}; |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using System.Runtime.Serialization; | |
using GuessWho; | |
using NUnit.Framework; |
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
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 |
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
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. |
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
import React, {Component, PropTypes} from 'react'; | |
import {SubscriptionProvider} from 'relay-subscriptions' | |
import uuid from 'uuid' | |
const outgoing = { | |
subscribe: 'subscribe', | |
ping: 'ping' | |
}; | |
const incoming = { |
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
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); |
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
<?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> |
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
import scala.concurrent.{ExecutionContext, Future} | |
import scala.concurrent.ExecutionContext.Implicits.global | |
object ModelReaders { | |
implicit object UserReader extends ModelReader[User] { | |
def read(repo: Repo, id: Int) = repo.getUser(id) | |
} | |
implicit object RoomReader extends ModelReader[Room] { | |
def read(repo: Repo, id: Int): Future[Option[Room]] = repo.getRoom(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
package com.company.serialization | |
import java.nio.ByteBuffer | |
import java.nio.charset.Charset | |
import akka.actor.{ActorRef, ExtendedActorSystem} | |
import akka.persistence.PersistentRepr | |
import akka.persistence.eventstore.EventStoreSerializer | |
import akka.persistence.eventstore.snapshot.EventStoreSnapshotStore.SnapshotEvent | |
import akka.persistence.journal.Tagged |