Skip to content

Instantly share code, notes, and snippets.

public class RequiredFieldAdorner : Adorner
{
public RequiredFieldAdorner(UIElement adornedElement)
: base(adornedElement)
{
}
protected override void OnRender(DrawingContext drawingContext)
{
var adornedElementRect = new Rect(AdornedElement.RenderSize);
@jen20
jen20 / gist:3737883
Created September 17, 2012 15:03
curl -i -H "Accept:application/atom+xml" "http://127.0.0.1:2113/streams/anewstream"
ouro@ouroboros:~$ curl -i -H "Accept:application/atom+xml" "http://127.0.0.1:2113/streams/anewstream"
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, PUT, DELETE
Content-Type: application/atom+xml
Server: Mono-HTTPAPI/1.0
Date: Sat, 08 Sep 2012 11:14:52 GMT
Content-Length: 1743
Keep-Alive: timeout=15,max=100
@jen20
jen20 / gist:3737892
Created September 17, 2012 15:04
curl -i -H "Accept:text/xml" "http://127.0.0.1:2113/streams/anewstream"
ouro@ouroboros:~$ curl -i -H "Accept:text/xml" "http://127.0.0.1:2113/streams/anewstream"
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, PUT, DELETE
Content-Type: text/xml
Server: Mono-HTTPAPI/1.0
Date: Sat, 08 Sep 2012 11:14:53 GMT
Content-Length: 1743
Keep-Alive: timeout=15,max=100
@jen20
jen20 / gist:3737905
Created September 17, 2012 15:06
curl -i -H "Accept:text/json" "http://127.0.0.1:2113/streams/anewstream"
greg@ouroboros:~$ curl -i -H "Accept:text/json" "http://127.0.0.1:2113/streams/anewstream"
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, GET, PUT, DELETE
Content-Type: application/json
Server: Mono-HTTPAPI/1.0
Date: Sat, 08 Sep 2012 16:04:07 GMT
Content-Length: 2312
Keep-Alive: timeout=15,max=100
@jen20
jen20 / gist:3737911
Created September 17, 2012 15:08
cat ~/Downloads/simpleevent.txt
ouro@ouroboros:~/src/EventStoreDocs$ cat ~/Downloads/simpleevent.txt
{
"CorrelationId": "0f7fac5b-d9cb-469f-a167-70867728950e",
"Events": [
{
"Data": {
"Foo": "Bar"
},
"EventId": "0f9fad5b-d9cb-469f-a165-70867728951e",
"EventType": "Type",
ouro@ouroboros$ curl -i http://127.0.0.1:2113/streams/newstream/event/1 -H "Accept: text/xml"
HTTP/1.1 200 OK
Access-Control-Allow-Methods: GET
Content-Type: text/xml
Server: Mono-HTTPAPI/1.0
Date: Thu, 13 Sep 2012 10:55:13 GMT
Content-Length: 312
Keep-Alive: timeout=15,max=100
<?xml version="1.0" encoding="UTF-8"?>
@jen20
jen20 / gist:3737939
Created September 17, 2012 15:15
ouro@ouroboros:~/src/EventStoreDocs$ curl -i http://127.0.0.1:2113/streams/newstream/event/1?format=json
ouro@ouroboros:~/src/EventStoreDocs$ curl -i http://127.0.0.1:2113/streams/newstream/event/1?format=json
HTTP/1.1 200 OK
Access-Control-Allow-Methods: GET
Content-Type: application/json
Server: Mono-HTTPAPI/1.0
Date: Thu, 13 Sep 2012 10:57:26 GMT
Content-Length: 208
Keep-Alive: timeout=15,max=100
{
@jen20
jen20 / usage.cs
Created September 17, 2012 15:58
C# Usage Examples
// Copyright (c) 2012, Event Store LLP
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using EventStore.ClientAPI.Data;
namespace GutterGrid
{
public class GGrid : Grid
{
public static readonly DependencyProperty NumberOfRowsProperty;
public static readonly DependencyProperty NumberOfColumnsProperty;
public static readonly DependencyProperty ColumnGutterWidthProperty;
public static readonly DependencyProperty RowGutterWidthProperty;
public new static readonly DependencyProperty RowProperty;
public new static readonly DependencyProperty ColumnProperty;
@jen20
jen20 / GetEventStoreRepository.cs
Last active August 13, 2018 18:36
Event Store implementation of the CommonDomain IRepository interface and integration tests
public class GetEventStoreRepository : IRepository
{
private const string EventClrTypeHeader = "EventClrTypeName";
private const string AggregateClrTypeHeader = "AggregateClrTypeName";
private const string CommitIdHeader = "CommitId";
private const int WritePageSize = 500;
private const int ReadPageSize = 500;
private readonly Func<Type, Guid, string> _aggregateIdToStreamName;