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
# Import the WebAdministration module if not already imported | |
if (-not (Get-Module -ListAvailable -Name WebAdministration)) { | |
Import-Module WebAdministration | |
} | |
# Retrieve the server name | |
$serverName = $env:COMPUTERNAME | |
# Retrieve all IIS websites | |
$websites = Get-Website |
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"?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>Unit Test Method</Title> | |
<Author>Siôn J. Lewis</Author> | |
<Description>Adds a unit test method with comments based on the AAA (Arrange,Act,Assert) pattern</Description> | |
<HelpUrl>https://msdn.microsoft.com/en-us/library/ms165394.aspx</HelpUrl> | |
<Shortcut>utest</Shortcut> | |
<SnippetTypes> |
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
GO | |
/****** Object: Schema [HangFire] Script Date: 19-May-20 16:26:21 ******/ | |
CREATE SCHEMA [HangFire] | |
GO | |
/****** Object: Table [dbo].[cmsTagToTopic] Script Date: 19-May-20 16:26:21 ******/ | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO |
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.Configuration; | |
using System.Linq; | |
using System.Reflection; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using log4net; | |
namespace Utils | |
{ |
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 bool IsValidContainer(string containerName) | |
{ | |
// Container names must be valid DNS names, and must conform to these rules: | |
// * Container names must start with a letter or number, and can contain only letters, numbers, and the dash (-) character. | |
// * Every dash (-) character must be immediately preceded and followed by a letter or number; consecutive dashes are not permitted in container names. | |
// * All letters in a container name must be lowercase. | |
// * Container names must be from 3 through 63 characters long. | |
// $root is a special container that can exist at the root level and is always valid. | |
if (containerName.Equals("$root")) |
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
DECLARE @tableName NVARCHAR(MAX), @schemaName NVARCHAR(MAX), @className NVARCHAR(MAX) | |
--------------- Input arguments --------------- | |
SET @tableName = 'MyTableName' | |
SET @schemaName = 'dbo' | |
SET @className = @tableName + 'Dto' | |
--------------- Input arguments end ----------- | |
DECLARE tableColumns CURSOR LOCAL FOR | |
SELECT cols.name, cols.system_type_id, cols.is_nullable FROM sys.columns cols |
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
[RoutePrefix("Chargebee")] | |
public class ChargebeeController : ApiController | |
{ | |
private readonly ILoggingService _loggingService; | |
private readonly TicketCountRepository _ticketCountRepository; | |
private readonly IBusinessRepository _businessRepository; | |
private readonly IBus _bus; | |
public ChargebeeController(ILoggingService loggingService, TicketCountRepository ticketCountRepository, IBusinessRepository businessRepository, | |
IBus bus) |
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.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Web.Http; | |
using Umbraco.Core.Models; | |
using Umbraco.Web.WebApi; | |
namespace U4_9904.Controllers | |
{ | |
public class MediaTestController : UmbracoApiController |
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.IO; | |
using System.Web.Hosting; | |
using Umbraco.Core; | |
using Umbraco.Core.Logging; | |
using Umbraco.Core.Models; | |
using Umbraco.Web; | |
using Umbraco.Web.WebApi; | |
/// <summary> |
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 CustomVersionProvider : IVersionProvider | |
{ | |
private Lazy<string> _productVersion = new Lazy<string>(() => | |
{ | |
var assembly = Assembly.GetExecutingAssembly(); | |
var assemblyVersion = assembly.GetName().Version; | |
var productVersion = string.Format("{0}.{1}.{2}", assemblyVersion.Major, assemblyVersion.Minor, assemblyVersion.Build); | |
// additional info | |
var dateFormat = "dd.MM.yyyyTHH:mm:ss"; | |
productVersion += string.Format(" (built: {0}) (LastWriteTime: {1})", |
NewerOlder