Skip to content

Instantly share code, notes, and snippets.

View rsoeteman's full-sized avatar

Richard Soeteman rsoeteman

View GitHub Profile
@rsoeteman
rsoeteman / gist:9c8e5a9c365cba3b925b2f5088bdf27e
Created May 24, 2024 09:39
Powershell script to convert backoffice language file to typescript
# Load the XML file
[xml]$xml = Get-Content 'en-US.xml'
# Initialize the output object
$output = @{}
# Iterate over each 'area' node
foreach ($area in $xml.language.ChildNodes) {
# Ignore 'language' and 'creator' nodes
if ($area.Name -eq 'language' -or $area.Name -eq 'creator') {
@rsoeteman
rsoeteman / gist:2b59b87f4eb15072166e49855538d64c
Created February 28, 2022 10:13
Use V2.x Package Garden Licensing
public sealed class ProductLicense
{
private readonly IHostingEnvironment _hostingEnvironment;
private readonly IHttpContextAccessor _contextAccessor;
private readonly ILogger<ProductLicense> _logger;
public ProductLicense(IHostingEnvironment hostingEnvironment, IHttpContextAccessor contextAccessor, ILogger<ProductLicense> logger)
{
_hostingEnvironment = hostingEnvironment;
_contextAccessor = contextAccessor;
@rsoeteman
rsoeteman / publishsample.cs
Created May 29, 2019 09:56
Sample how we can create relations for CMSImport on publish of an Umbraco content node
using System.Configuration;
using CMSImportLibrary.Helpers;
using Umbraco.Core;
using Umbraco.Core.Services;
namespace UpdateUmbracoRelations
{
public class PublishedEventHandler : ApplicationEventHandler
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
@rsoeteman
rsoeteman / routetable.cshtml
Created May 7, 2019 13:33
List all routes
@foreach (var route in RouteTable.Routes.OfType<Route>())
{
var r = (Route)route;
<div>@r.Url</div>
}
[RuntimeLevel(MinLevel = RuntimeLevel.Run)]
public class SEOCheckerComposer : IUserComposer
{
public void Compose(Composition composition)
{
//Make sure app exists
composition.WithCollectionBuilder<SectionCollectionBuilder>()
.Append<SEOCheckerApplication>();
}