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
<# | |
AppVeyor Deployment Script | |
This script is run after deployment to the web server. | |
It substitutes environment variables in the appsettings.json file with values from the environment. | |
All environment variables that start with the prefix are loaded and substituted into the appsettings.json file | |
e.g. if the prefix is "APP_" then the environment variable "APP_ConnectionStrings.umbracoDbDSN" will set | |
the value of "ConnectionStrings.umbracoDbDSN" in the appsettings.json file. |
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 NullableDatePickerValueConverter : DatePickerValueConverter | |
{ | |
public override Type GetPropertyValueType(IPublishedPropertyType propertyType) => typeof(DateTime?); | |
public override object? ConvertSourceToIntermediate( | |
IPublishedElement owner, | |
IPublishedPropertyType propertyType, | |
object source, | |
bool preview) |
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 CustomDocumentRepository : DocumentRepository | |
{ | |
private static readonly string[] allowNonUniqueChildNames = { EventsPage.ModelTypeAlias, NewsPage.ModelTypeAlias }; | |
public CustomDocumentRepository( | |
IScopeAccessor scopeAccessor, | |
AppCaches appCaches, | |
ILogger<DocumentRepository> logger, | |
ILoggerFactory loggerFactory, | |
IContentTypeRepository contentTypeRepository, |
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 IEnumerable<IEnumerable<T>> ChunkEvenly<T>(this IEnumerable<T> list, int chunkCount) | |
{ | |
int groups = 0; | |
int total = 0; | |
int count = list.Count(); | |
while (total < count) | |
{ | |
var size = (int)Math.Ceiling((count - total) / (decimal)(chunkCount - groups)); | |
yield return list.Skip(total).Take(size); | |
groups++; |
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.Collections.Specialized; | |
using System.Globalization; | |
using System.Linq; | |
using System.Text; | |
using System.Web; | |
namespace MooseCoding.Web.UI | |
{ | |
public static class ResponsiveImageHelper | |
{ |
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
//... | |
[assembly: PreApplicationStartMethod(typeof(Initializr), "Init")] | |
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 DefaultController : RenderMvcController | |
{ | |
[UmbracoDonutOutputCache(CacheProfile = "LongPageCache", | |
Options = OutputCacheOptions.NoCacheLookupForPosts & | |
OutputCacheOptions.ReplaceDonutsInChildActions, Order = 100)] | |
public override ActionResult Index(RenderModel model) | |
{ | |
return base.Index(model); | |
} | |
} |