Skip to content

Instantly share code, notes, and snippets.

View dawoe's full-sized avatar

Dave Woestenborghs dawoe

  • DotControl
  • Dilsen-Stokkem, Belgium
  • X @dawoe21
View GitHub Profile
@dawoe
dawoe / CreateOnlyDictionaryHandler.cs
Created October 16, 2019 11:07 — forked from jamiepollock/CreateOnlyDictionaryHandler.cs
A uSync custom DictionaryHandler which only imports items if they're missing. It will not overwrite any existing authored translations.
using Jumoo.uSync.BackOffice;
using Jumoo.uSync.BackOffice.Handlers;
using Jumoo.uSync.BackOffice.Helpers;
using Jumoo.uSync.Core;
using Jumoo.uSync.Core.Extensions;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml.Linq;
@dawoe
dawoe / web.config
Created August 22, 2018 10:36
Redirect based on browser language
<rule name="RedirectToDutchHomepage" enabled="true" stopProcessing="true">
<match url="^$"></match>
<conditions>
<add input="{HTTP_ACCEPT_LANGUAGE}" pattern="^nl"></add>
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/nl/"></action>
</rule>
<rule name="RedirectToFrenchHomepage" enabled="true" stopProcessing="true">
<match url="^$"></match>
<conditions>
@dawoe
dawoe / DefaultController.cs
Created November 7, 2017 08:20
Donut Cache examples from Umbraco UK Festival talk "The need for speed"
public class DefaultController : RenderMvcController
{
[UmbracoDonutOutputCache(CacheProfile = "LongPageCache",
Options = OutputCacheOptions.NoCacheLookupForPosts &
OutputCacheOptions.ReplaceDonutsInChildActions, Order = 100)]
public override ActionResult Index(RenderModel model)
{
return base.Index(model);
}
}