Skip to content

Instantly share code, notes, and snippets.

Avatar
🚴

Kevin Jump KevinJump

🚴
View GitHub Profile
@KevinJump
KevinJump / maintain.cs
Last active Feb 20, 2022
change umbraco content in middleware (example, may need some work!)
View maintain.cs
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using System.IO;
using System.Threading.Tasks;
using Umbraco.Cms.Core.Composing;
View LeBlenderMapper.cs
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
@KevinJump
KevinJump / numbraco.ps1
Last active Oct 28, 2021
Umbraco Setup and tear down scripts. (Gives you an approx 35 second Umbraco install)
View numbraco.ps1
# statup umbraco, and add some packages if you want
#
# e.g numbraco MyTestSite uSync Jumoo.TranslationManager vendr -NoStarter
#
# extras!!!
#
# open vscode in the folder as part of the build
# numbraco MyTestSite -code
#
# don't run the site
View ITranslationProvider.cs
using Jumoo.TranslationManager.Core.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Umbraco.Core;
namespace Jumoo.TranslationManager.Core.Providers
{
@KevinJump
KevinJump / DisableuSyncCache.cs
Created May 19, 2021
Disables uSync.Complete's sync cache - which is used to speed up publishing - however if you have performance issues you can remove it.
View DisableuSyncCache.cs
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 Jan 25, 2021
theoretical uSync handler that syncs the dictionary in the 'settings' group not the content one
View settingsDictionaryHandler.cs
/// 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.
/// you would need to update your usync8.config.
using Umbraco.Core.Cache;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using uSync8.BackOffice;
@KevinJump
KevinJump / TranslationManagerNugetUpdater.cs
Last active Nov 17, 2020
Example code to use the Translation Manager's internal link updater to update links between two sites.
View TranslationManagerNugetUpdater.cs
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 Oct 12, 2020
Umbraco service to load ebooks as content.
View bookcontent-bookservice.cs
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;
View TranslationManagerJobEvents.cs
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
Umbraco SilentUpgrade : Run the Umbraco Upgrade silently with no redirect to the /install url for users. (see https://github.com/KevinJump/Our.Umbraco.SilentUpgrade)
View SilentUpgradeStartup.cs
/*
* 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.