Skip to content

Instantly share code, notes, and snippets.

View jamescrowley's full-sized avatar

James Crowley jamescrowley

View GitHub Profile
@joefitzgerald
joefitzgerald / Vagrantfile
Last active July 6, 2018 12:33
Windows Vagrantfile - Installs .NET 4.5, VS 2012, VS 2012 Update 3, then a bunch of utilities, then syspreps the machine. Get https://github.com/joefitzgerald/packer-windows for the base box and add it with the name "windows2008r2".
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define "vagrant-windows"
config.vm.box = "windows2008r2"
# You should be using the vagrant-windows Vagrant Plugin!
# Admin user name and password
config.winrm.username = "Administrator"
@ltudury
ltudury / nxlog_loggly.conf
Last active January 14, 2020 20:29
NXLog configuration that can be used to send Windows events to Loggly. Include your unique customer token where specified.
## This is a sample NXLog configuration file created by Loggly. June 2013
## See the nxlog reference manual about the configuration options.
## It should be installed locally and is also available
## online at http://nxlog.org/nxlog-docs/en/nxlog-reference-manual.html
## Please set the ROOT to the folder your nxlog was installed into,
## otherwise it will not start.
#define ROOT C:\Program Files\nxlog
define ROOT C:\Program Files (x86)\nxlog
@mbenford
mbenford / Bootstrap.bat
Created May 27, 2013 19:09
Bootstrap script to register a Tentacle with an Octopus server and deploy a release to its environment/role. Requires a Tentacle installer and Octo.exe in the same directory of the script.
start /wait msiexec /i Octopus.Tentacle.<version>.msi /quiet INSTALLLOCATION=C:\Octopus
cd C:\Octopus\Agent
tentacle configure --appdir="C:\Applications" --port=10933 --trust=<server-thumbprint>
tentacle new-certificate
tentacle install
tentacle register-with --server=<server-url> --environment=<environment> --role=<role> --apikey=<some-user-apikey>
octo deploy-release --project=<project-name> --deployto=<environment-to-deploy> --version=<version-to-deploy> --server=<server-url> --apikey=<some-user-apikey>
@stevenkuhn
stevenkuhn / gist:5062660
Last active March 7, 2023 16:03
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.
#
# 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 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;
@gregoryyoung
gregoryyoung / gist:4406378
Last active June 27, 2022 19:58
Sample Event Producer for Projections Demos
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 December 7, 2012 00:28
Angular Compatible Date Formatting with JSON.NET
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";
@mikeobrien
mikeobrien / DownloadDataBehavior.cs
Created April 20, 2012 17:09
Download data convention
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;
@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 April 9, 2012 05:58
C# Wrapper for WKHTMLtoPDF
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Web;
using System.Web.Hosting;
namespace PdfGenerator
{
public class PdfGenerator