Skip to content

Instantly share code, notes, and snippets.

View ronaldbarendse's full-sized avatar

Ronald Barendse ronaldbarendse

View GitHub Profile
@ronaldbarendse
ronaldbarendse / SQLiteMemoryComposer.cs
Created December 13, 2023 08:52
Ensure SQLite in-memory database is persisted for the whole application lifetime.
using Microsoft.Data.Sqlite;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Composing;
/// <summary>
/// Ensure SQLite in-memory database is persisted for the whole application lifetime.
/// </summary>
internal sealed class SQLiteMemoryComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
blueprint:
name: ZHA - Ecodim, 4 Channel remote
description: Control any light using the Ecodim remote on ZHA
domain: automation
input:
remote:
name: Remote controller
description: Remote to use
selector:
device:
@ronaldbarendse
ronaldbarendse / PrunePropertyDataComponent.cs
Last active January 3, 2022 13:01
Umbraco 8 - Clean-up and prune property data
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json.Linq;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Editors;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Scoping;
@ronaldbarendse
ronaldbarendse / PruneImageCropperPropertyDataComponent.cs
Created December 30, 2021 10:36
Umbraco 8 - Prune existing Image Cropper and Media Picker (v3) values
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.PropertyEditors.ValueConverters;
using Umbraco.Core.Services;
public class PruneImageCropperPropertyDataComposer : ComponentComposer<PruneImageCropperPropertyDataComponent>
{ }
@ronaldbarendse
ronaldbarendse / DataEditorTests-v8.cs
Last active December 6, 2021 13:03
Umbraco - create document type with all data editors/types to test readonly editors
using System;
using System.Linq;
using System.Web.Http.Filters;
using Umbraco.Core.Composing;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
using Umbraco.Web.Editors;
using Umbraco.Web.Models.ContentEditing;
@ronaldbarendse
ronaldbarendse / Install.ps1
Created November 1, 2021 08:43
Umbraco 9 install script
# Optional cleanup for repeated tests
Remove-Item "Umbraco9" -Recurse -ErrorAction SilentlyContinue
Remove-Item "Umbraco9.sln" -ErrorAction SilentlyContinue
# Configure these values to automatically create a back-office user
#Set-Item Env:\UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERNAME "Administrator"
#Set-Item Env:\UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL "umbraco@example.com"
#Set-Item Env:\UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD "1234567890"
# Ensure the latest Umbraco templates are installed
@ronaldbarendse
ronaldbarendse / PublishedContentPageService.cs
Created September 4, 2020 08:14
Umbraco Forms IPageService implementations
using System.Collections;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Forms.Core.Services;
using Umbraco.Web;
public class PublishedContentPageService : IPageService
{
protected readonly IUmbracoContextAccessor umbracoContextAccessor;
public PublishedContentPageService(IUmbracoContextAccessor umbracoContextAccessor)