Skip to content

Instantly share code, notes, and snippets.

View KevinJump's full-sized avatar
🚴

Kevin Jump KevinJump

🚴
View GitHub Profile
@KevinJump
KevinJump / DisableuSyncCache.cs
Created May 19, 2021 11:40
Disables uSync.Complete's sync cache - which is used to speed up publishing - however if you have performance issues you can remove it.
using Umbraco.Core;
using Umbraco.Core.Composing;
using uSync.Expansions.Core.Cache;
namespace uSyncCacheDisable
{
[RuntimeLevel(MinLevel = RuntimeLevel.Run)]
[ComposeAfter(typeof(SyncCacheComposer))]
@KevinJump
KevinJump / settingsDictionaryHandler.cs
Last active October 13, 2022 10:08
Note: this can now be done in usync with no custom code : https://github.com/KevinJump/uSync/releases/tag/8.4.4
/// ****************************************************
/// NOTE: As of uSync 8.8.4 this functionaliy exists in the core of the package
/// https://github.com/KevinJump/uSync/releases/tag/8.4.4
///
/// With ContentEdition Installed you can move the dictionayHandler with a Group="Settings" attribute in the config file.
/// ****************************************************
/// uSync Dictionary Handler
/// untested code - in theory this would make a dictionary handler that synced with the settings group in uSync not the content one.
@KevinJump
KevinJump / TranslationManagerNugetUpdater.cs
Last active November 17, 2020 10:53
Example code to use the Translation Manager's internal link updater to update links between two sites.
using System.Linq;
using Umbraco.Core.Models;
using Jumoo.TranslationManager.Core.Services;
using Jumoo.TranslationManager.LinkUpdater;
namespace MyLinkUpdater
{
/// <summary>
/// Update links inside content based on the setup in translation manager.
/// </summary>
@KevinJump
KevinJump / bookcontent-bookservice.cs
Created October 12, 2020 20:06
Umbraco service to load ebooks as content.
using HtmlAgilityPack;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using VersOne.Epub;
using Jumoo.TranslationManager.Core.Services;
using Umbraco.Core;
using Umbraco.Core.Logging;
namespace TranslationManager.Events
{
/// <summary>
/// Exmaple how listen for events on translation jobs. in Translation Manager (v2.x)
/// </summary>
@KevinJump
KevinJump / SilentUpgradeStartup.cs
Last active May 19, 2020 11:03
Umbraco SilentUpgrade : Run the Umbraco Upgrade silently with no redirect to the /install url for users. (see https://github.com/KevinJump/Our.Umbraco.SilentUpgrade)
/*
* Silent Upgrade for Umbraco v8.
* ---------------------------------
*
* HEALTH WARNING: Look this is doing some internal umbraco 'messing' about, using this
* to auto upgrade your umbraco installations is done at your own risk.
*
* This code will run when your site is in Upgrade mode.
* This happens when the version in web.config or the database migrations don't
* match what the umbraco code thinks should be the version.
@KevinJump
KevinJump / NodeNameCopy.cs
Created May 6, 2020 08:40
TranslationManager : Copy the NodeName on TranslationJob Approval
using System;
using Jumoo.TranslationManager.Core.Services;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Services;
namespace Jumoo.Translation.ExampleCode
{
//
// Example Code : CopyNodeName on Approval
@KevinJump
KevinJump / vortohealthcheck.cs
Created March 31, 2020 07:44
Quick and dirty Health check to fix non-json vorto properties, if you change from a text property to a vorto one, then the stored values will need updating, this health check can do that
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Web.HealthCheck;
@KevinJump
KevinJump / LeBlenderValueMapper.cs
Created November 1, 2019 14:41
LeBlender Value mapper for Translation Manager for v2.x
using Jumoo.TranslationManager.Core.Models;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
@KevinJump
KevinJump / uSyncCacheRebuild.cs
Last active September 26, 2019 14:33
uSync 8.2 Cache rebuild
using System.Linq;
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.Services.Changes;
using Umbraco.Web.Cache;
using Umbraco.Web.PublishedCache;
using uSync8.BackOffice;
namespace uSync8.EventTriggers