This file contains hidden or 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
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] | |
public class ConfigurationPropertyAttribute : Attribute, IComparable<ConfigurationPropertyAttribute> | |
{ | |
public ConfigurationPropertyAttribute(string displayName) | |
{ | |
DisplayName = displayName; | |
} | |
public string DisplayName { get; set; } |
This file contains hidden or 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 void Sort(this ListItemCollection items) | |
{ | |
IList<ListItem> itemList = new List<ListItem>(); | |
foreach (ListItem item in items) | |
itemList.Add(item); | |
IEnumerable<ListItem> itemEnum = | |
from item in itemList orderby item.Text select item; | |
items.Clear(); |
This file contains hidden or 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 ICommunicationObjectExtensions | |
{ | |
public static void TryCloseOrAbort(this ICommunicationObject obj) | |
{ | |
if (obj != null) | |
{ | |
if (obj.State != CommunicationState.Faulted && | |
obj.State != CommunicationState.Closed) | |
{ | |
try { obj.Close(); } |
This file contains hidden or 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 Dapper; | |
public class EmployeeController : Controller | |
{ | |
private IDbContext DbContext { get; set; } | |
public EmployeeController(IDbContext dbContext) | |
{ | |
DbContext = dbContext; | |
} |
This file contains hidden or 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
private void ProcessEvents() { | |
using (var client = redisManager.GetClient()) { | |
// incoming events are JSON, so deserialize each one to IDictionary<>. | |
var events = client.GetTypedClient<IDictionary<string, object>>().Lists["urn:events"]; | |
while (true) { | |
// wait for next event, then convert it to an ExpandoObject; | |
dynamic @event = events.BlockingDequeue(null).ToExpando(); |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Octopus Release Information</title> | |
<style type="text/css"> | |
</style> | |
</head> | |
<body> | |
<div data-bind="visible: version() != ''"> |
This file contains hidden or 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
$configFile = Get-Item .\nexuspwn.Service.exe.config | |
$xml = [xml](Get-Content $configFile) | |
$smtpNode = $xml.SelectSingleNode("/configuration/system.net/mailSettings/smtp") | |
$smtpNode.network.host = $OctopusParameters["MailSettings.Smtp.Network.Host"] | |
$smtpNode.network.port = $OctopusParameters["MailSettings.Smtp.Network.Port"] | |
$smtpNode.network.enableSsl = $OctopusParameters["MailSettings.Smtp.Network.EnableSsl"] | |
$smtpNode.network.userName = $OctopusParameters["MailSettings.Smtp.Network.UserName"] | |
$smtpNode.network.password = $OctopusParameters["MailSettings.Smtp.Network.Password"] |
This file contains hidden or 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
# | |
# 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. | |
# |
This file contains hidden or 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
## Octopus Azure deployment script, version 1.1 | |
## -------------------------------------------------------------------------------------- | |
## | |
## This script is used to control how we deploy packages to Windows Azure. | |
## | |
## When the script is run, the correct Azure subscription will ALREADY be selected, | |
## and we'll have loaded the neccessary management certificates. The Azure PowerShell module | |
## will also be loaded. | |
## | |
## If you want to customize the Azure deployment process, simply copy this script into |
This file contains hidden or 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 LocalFileStoreProvider : IFileStoreProvider | |
{ | |
public bool SaveScreenshot(FluentSettings settings, byte[] contents, string fileName) | |
{ | |
try | |
{ | |
if (!string.IsNullOrEmpty(settings.ScreenshotPrefix)) | |
{ | |
fileName = Path.Combine( | |
Path.GetDirectoryName(fileName), |
OlderNewer