Skip to content

Instantly share code, notes, and snippets.

View mattbrailsford's full-sized avatar

Matt Brailsford mattbrailsford

View GitHub Profile
  1. Add .gitignore to static assets project with wwwroot/
  2. Update vite configuration with outDir "../wwwroot/"
  3. Remove Build\Microsoft.AspNetCore.ClientAssets.targets
  4. Create Build\ClientAssets.targets with the following contents
<Project>
  
  <PropertyGroup>
 Client\
@mattbrailsford
mattbrailsford / Links.txt
Last active April 26, 2023 12:18
Master branch naming research
@mattbrailsford
mattbrailsford / todos.cs
Created August 3, 2022 12:49
REST Konstrukt Repository
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text.Json;
using Konstrukt.Persistence;
using Konstrukt.Web.Site.Models;
using Umbraco.Cms.Core.Models;
@mattbrailsford
mattbrailsford / PriceBreakOrderLineCalculator.cs
Last active May 3, 2022 13:02
Example order line calculator that support price breaks
using System;
using System.Collections.Generic;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Web;
using Vendr.Core.Calculators;
using Vendr.Core.Models;
using Vendr.Core.Services;
using Vendr.Web.Models;
namespace Vendr.DemoStore.Web.Calculators
public class UmbracoSurfaceControllerDependencies
{
#if NET
public IUmbracoContextAccessor UmbracoContextAccessor { get; set; }
public IUmbracoDatabaseFactory DatabaseFactory { get; set; }
public ServiceContext Services { get; set; }
public AppCaches AppCaches { get; set; }
public IProfilingLogger ProfilingLogger { get; set; }
public IPublishedUrlProvider PublishedUrlProvider { get; set; }
@mattbrailsford
mattbrailsford / Controller.cs
Created February 11, 2022 09:52
Published Content Wrapper for v8 + v9
public class MyController : Controller
{
private readonly PublishedContentWrapperFactory _publishedContentWrapper;
public MyController(PublishedContentWrapperFactory publishedContentWrapper)
=> _publishedContentWrapper = publishedContentWrapper;
[HttpGet]
public IActionResult DoSomething()
{
@mattbrailsford
mattbrailsford / function.json
Last active October 29, 2021 08:12
Azure SignalR Service AutoScale Powershell Azure Function
{
"bindings": [
{
"name": "Timer",
"type": "timerTrigger",
"direction": "in",
"schedule": "0 */5 * * * *"
}
]
}
@mattbrailsford
mattbrailsford / .travis.yml
Last active September 12, 2021 13:49
Configuration for deploying a NUXT static site to github pages
language: node_js
node_js:
- "8"
cache:
directories:
- "node_modules"
branches:
only:
@mattbrailsford
mattbrailsford / GitVersion.yml
Last active August 16, 2021 13:40
GitVersion config that supports explicit alpha, beta and rc releases
branches:
master:
regex: ^ma[ster|in]
release-alpha:
regex: ^releases?[/-](.*)-alpha$
mode: ContinuousDeployment
tag: alpha
increment: Patch
prevent-increment-of-merged-branch-version: true
track-merge-target: false
@mattbrailsford
mattbrailsford / ContentExtensions.cs
Last active March 23, 2021 16:57
Converts an IContent element to IPublishedContent in Umbraco v8
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Strings;
using Umbraco.Web.Composing;