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 LocalFileStoreProvider : IFileStoreProvider | |
{ | |
public bool SaveScreenshot(FluentSettings settings, byte[] contents, string fileName) | |
{ | |
try | |
{ | |
if (!string.IsNullOrEmpty(settings.ScreenshotPrefix)) | |
{ | |
fileName = Path.Combine( | |
Path.GetDirectoryName(fileName), |
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 IISExpressFixture : IDisposable | |
{ | |
public Uri Server { get; private set; } | |
public string SitePath { get; private set; } | |
private readonly Process _process; | |
public IISExpressFixture() | |
{ | |
// Run site on a random port to prevent port clashes |
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
[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 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 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 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 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 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 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 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 | |
{ | |
public static void Main(string[] args) | |
{ | |
if (args == null || args.Length == 0) throw new InvalidOperationException("You must specify arguments."); | |
var path = args[0]; | |
using (var server = TestServer.Create<Startup>()) | |
{ |
OlderNewer