Skip to content

Instantly share code, notes, and snippets.

@deMD
deMD / RiderFileLayout.xml
Created January 15, 2024 14:53
Rider C# File Layout Template with layout for public, internal and private methods. Also makes sure the CreateNull method is always directly below constructor for findability
<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns">
<TypePattern DisplayName="Non-reorderable types">
<TypePattern.Match>
<Or>
<And>
<Kind Is="Interface" />
<Or>
<HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" />
<HasAttribute Name="System.Runtime.InteropServices.ComImport" />
</Or>
@deMD
deMD / CdnMediaUrlProvider.cs
Created December 17, 2019 10:38
Umbraco CdnMediaUrlProvider
public class CdnMediaUrlProvider : IMediaUrlProvider
{
public virtual UrlInfo GetMediaUrl(
UmbracoContext umbracoContext,
IPublishedContent content,
string propertyAlias,
UrlMode mode,
string culture,
Uri current)
{
@deMD
deMD / CommonServices
Created September 8, 2016 07:13
Code used to enable Ninject in Umbraco
using Ninject;
using Umbraco.IocTest.BLL.Providers;
using Umbraco.IocTest.Core.Interfaces;
namespace Umbraco.IocTest.BLL
{
/// <summary>
/// The CommonServices are services that are a 1:1 pair with an implemnting class.
/// For example: A single provider interface can only have one implmentation,
/// thus this is registered in the common services.