Skip to content

Instantly share code, notes, and snippets.

@barryokane
barryokane / PatternLibRazorViewEngine.cs
Created March 11, 2017 04:56
Inspired by Heather Floyd's article (http://24days.in/umbraco-cms/2016/unique-sites-using-theming), however our use case is slightly different: we want to share a library of partials between multiple Umbraco sites with custom overrides on specific sites
using System.Linq;
using Umbraco.Web.Mvc;
namespace Endzone.Umbraco.PatternLib
{
public class PatternLibRazorViewEngine : RenderViewEngine
{
public PatternLibRazorViewEngine() : base()
{
/*
@barryokane
barryokane / Check list of URLs for 301.ps
Last active October 28, 2022 10:47
Powershell script to loop over a list of URLs, make a HTTP HEAD request and check for (first) 301 response.
#-------------
# Script to loop over a list of URLs, make a HTTP HEAD request and check for (first) 301 response
# INPUT: A txt file with one URL per line
#
# OUTPUT: A CSV file with columns for:
# - RequestURI = the URI from than line in input file
# - StatusCode = response status code (blank if error code!)
# - Error = Error message (for 404 or 500 errors)
#
@barryokane
barryokane / app_offline.htm
Last active June 15, 2018 03:25
Simple app_offline.htm with no-cache meta tags, to discourage browsers from caching the maintenance message.
<html>
<head>
<title>Maintenance underway</title>
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
</head>
<body>