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
/// <summary> | |
/// This is just a helper class to make resolving dependencies manually a bit tidier | |
/// </summary> | |
public static class WebApiDependencyResolver | |
{ | |
/// <summary> | |
/// Use configured WebApi DependencyResolver to resolve dependency of type T. | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
/// <returns></returns> |
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
/// <summary> | |
/// Base class for Import/Export ModelState From/To TempData action filters | |
/// </summary> | |
public abstract class ModelStateTempDataAttribute : ActionFilterAttribute | |
{ | |
protected static readonly string Key = typeof(ModelStateTempDataAttribute).FullName; | |
} | |
/// <summary> | |
/// Import ModelState from previous ActionMethod from TempData |
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 System; | |
using System.Net.NetworkInformation; | |
namespace ServiceLayer.Utilities.Identity | |
{ | |
/// <summary> | |
/// Class used to get a unique machine identifier | |
/// </summary> | |
public static class MachineIdentifier | |
{ |
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
$PSPath = 'MACHINE/WEBROOT/APPHOST/' + $WebsiteName | |
$Filter = 'system.webServer/httpProtocol/customHeaders' | |
# Ensure working with IIS 7 and 7.5(+?) | |
try { | |
Add-PSSnapin WebAdministration | |
} | |
catch { | |
try { | |
Import-Module WebAdministration |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<meta-runner name="Cake"> | |
<description>Execute a cake script</description> | |
<settings> | |
<parameters> | |
<param name="mr.Cake.script" value="" spec="text description='The location of the Cake Script, relative to the root folder' display='normal' label='Cake Script:'" /> | |
<param name="mr.Cake.target" value="" spec="text description='The name of the Target within the Cake Script to execute' display='normal' label='Target:'" /> | |
<param name="mr.Cake.verbosity" value="" spec="select data_1='Quiet' data_3='Minimal' data_5='Normal' data_7='Verbose' data_9='Diagnostic' description='The logging level for the Cake Script' display='normal' label='Verbosity:'" /> | |
<param name="mr.Cake.arguments" value="" spec="text description='Additional arguments to pass to Cake Script' display='normal' label='Cake Arguments:'" /> | |
</parameters> |
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
-- Check user with access | |
SELECT | |
p.loginame | |
FROM | |
sys.databases d | |
inner join sys.sysprocesses p ON (d.database_id = p.[dbid]) | |
WHERE | |
d.name = 'database_name' | |
-- Try to grab database 1000 times |
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
var varsFile = Octopus.Parameters["tfvarsfile"]; | |
Console.WriteLine("Parsing tfVarsFile: " + varsFile); | |
if (string.IsNullOrEmpty(varsFile)) | |
throw new ApplicationException("You must provide a tf vars file location"); | |
if (!File.Exists(varsFile)) | |
throw new ApplicationException(string.Format("Specified tf vars file, {0}, not found", varsFile)); | |
string tempFile = string.Concat(varsFile, "-temp"); |
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 abstract class DevelopmentNonRunningSchedule : DailySchedule | |
{ | |
protected DevelopmentNonRunningSchedule(params string[] times) : base(times) | |
{ | |
} | |
protected DevelopmentNonRunningSchedule() : base() | |
{ | |
} |
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
/// <summary> | |
/// Creates a <see cref="T:System.Collections.Generic.Dictionary`2" /> from an <see cref="T:System.Collections.Generic.IEnumerable`1" /> according to specified key selector and element selector functions. | |
/// If duplicates keys are present, only the first will be used. Values with duplicate keys will be ignored. | |
/// </summary> | |
/// <typeparam name="TSource">The type of the elements of <paramref name="source" />.</typeparam> | |
/// <typeparam name="TKey">The type of the key returned by <paramref name="keySelector" />.</typeparam> | |
/// <typeparam name="TValue">The type of the value returned by <paramref name="elementSelector" />.</typeparam> | |
/// <param name="source">An <see cref="T:System.Collections.Generic.IEnumerable`1" /> to create a <see cref="T:System.Collections.Generic.Dictionary`2" /> from.</param> | |
/// <param name="keySelector">A function to extract a key from each element.</param> | |
/// <param name="elementSelector">A transform function to produce a result element value from each element.</para |
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
const Koa = require('koa'); | |
const app = new Koa(); | |
app.use(async (ctx, next) => { | |
console.log(`${ctx.method} ${ctx.url}`); | |
const responseCode = ctx.url.startsWith('/') ? ctx.url.substring(1) : 200; | |
const delay = ctx.response.get('X-Delay-Ms'); | |
if (delay) { | |
setTimeout(() => { | |
console.debug('done...'); |
OlderNewer