Skip to content

Instantly share code, notes, and snippets.

Avatar

James Crowley jamescrowley

View GitHub Profile
@stevenkuhn
stevenkuhn / gist:5062660
Last active Feb 4, 2021
This PowerShell script generates release notes for Octopus Deploy that contain the GitHub commits and JIRA issues from the current build to the latest production release. It will also create the Octopus release based on the TeamCity build number.
View gist:5062660
#
# Assumptions
#
# 1. If you have a Octopus release deployed, say 1.0.0.73, there is a git
# tag set for that commit in GitHub that is "v1.0.0.73".
#
# 2. You have TeamCity label each successful build in GitHub with the format
# "v{build number}. Sidenote: it appears that TeamCity only labels the
# default branch, but not feature branches.
#
@jen20
jen20 / GetEventStoreRepository.cs
Last active Aug 13, 2018
Event Store implementation of the CommonDomain IRepository interface and integration tests
View GetEventStoreRepository.cs
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;
@gregoryyoung
gregoryyoung / gist:4406378
Last active Dec 10, 2015
Sample Event Producer for Projections Demos
View gist:4406378
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using EventStore.ClientAPI;
namespace marketdata
{
@pagebrooks
pagebrooks / JsonNetResult.cs
Created Dec 7, 2012
Angular Compatible Date Formatting with JSON.NET
View JsonNetResult.cs
public class JsonNetResult : JsonResult
{
private readonly static JsonSerializerSettings Settings;
private readonly static IsoDateTimeConverter _dateTimeConverter;
static JsonNetResult()
{
_dateTimeConverter = new IsoDateTimeConverter();
// Default for IsoDateTimeConverter is yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK
_dateTimeConverter.DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFK";
View DownloadDataBehavior.cs
public class DownloadDataModel
{
public string Data { get; set; }
public string Filename { get; set; }
public string MimeType { get; set; }
}
public class DownloadDataBehavior : BasicBehavior
{
private readonly IFubuRequest _request;
View Edit.cshtml
@model EditUserModel
@using (Html.BeginForm())
{
<div>
@Html.HiddenFor(m => m.Id)
@Html.TextBoxFor(m => m.FirstName)
@Html.TextBoxFor(m => m.LastName)
@Html.DropDownListFor(m => m.CountryId, Model.Countries)
@johnnyreilly
johnnyreilly / PdfGenerator.cs
Created Apr 9, 2012
C# Wrapper for WKHTMLtoPDF
View PdfGenerator.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Web;
using System.Web.Hosting;
namespace PdfGenerator
{
public class PdfGenerator
@PaulStovell
PaulStovell / Group.cs
Created Mar 31, 2012
Hierarchies in RavenDB
View Group.cs
public class Group
{
public Group()
{
Users = new List<string>();
ChildGroups = new List<string>();
}
public string Id { get; set; }
public string Name { get; set; }
@CoreyKaylor
CoreyKaylor / ModelUrlResolutionCache.cs
Created Jan 5, 2012
Transforms InputModel for FubuMVC into the route for asset files, this makes routes refactor friendly and safe from route changes
View ModelUrlResolutionCache.cs
public class ModelUrlResolutionCache : IModelUrlResolver
{
static Cache<string, string> _inputModelTypeCache;
public ModelUrlResolutionCache(IUrlRegistry urlRegistry, BehaviorGraph graph)
{
if (_inputModelTypeCache == null)
_inputModelTypeCache = new Cache<string, string>(inputModel =>
{
var inputType = Type.GetType(inputModel)
@joliver
joliver / gist:1311195
Created Oct 25, 2011
NServiceBusCommitDispatcher
View gist:1311195
public sealed class NServiceBusCommitDispatcher : IPublishMessages
{
private const string AggregateIdKey = "AggregateId";
private const string CommitVersionKey = "CommitVersion";
private const string EventVersionKey = "EventVersion";
private const string BusPrefixKey = "Bus.";
private readonly IBus bus;
public NServiceBusCommitDispatcher(IBus bus)
{