This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dotnet new umbraco -n UmbracoUnattended --connection-string "Server=GORDON\SQLExpress;Database=UmbracoUnattended;User Id=sa;Password=abc123;" | |
cd UmbracoUnattended | |
Set-Item Env:\UMBRACO__CMS__GLOBAL__INSTALLMISSINGDATABASE true | |
Set-Item Env:\UMBRACO__CMS__UNATTENDED__INSTALLUNATTENDED true | |
Set-Item Env:\UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERNAME "Test" | |
Set-Item Env:\UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL "[email protected]" | |
Set-Item Env:\UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD "test123456" | |
dotnet add package Umbraco.TheStarterKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ProductComponent : IComponent | |
{ | |
private readonly IExamineManager _examineManager; | |
private readonly ProductIndexCreator _productIndexCreator; | |
public ProductComponent (IExamineManager examineManager, ProductIndexCreator productIndexCreator) | |
{ | |
_examineManager = examineManager; | |
_productIndexCreator = productIndexCreator; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ##### ImageSharp ##### | |
using (var image = Image.Load<Rgb24>(inPath)) | |
{ | |
image.Mutate( | |
x => x | |
// Scale the image down preserving the aspect ratio. This will speed up quantization. | |
// We use nearest neighbor as it will be the fastest approach. | |
.Resize(new ResizeOptions() { Sampler = KnownResamplers.NearestNeighbor, Size = new Size(100, 0) }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DefaultController : RenderMvcController | |
{ | |
[UmbracoDonutOutputCache(CacheProfile = "LongPageCache", | |
Options = OutputCacheOptions.NoCacheLookupForPosts & | |
OutputCacheOptions.ReplaceDonutsInChildActions, Order = 100)] | |
public override ActionResult Index(RenderModel model) | |
{ | |
return base.Index(model); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See https://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit, jQuery version with arrays and objects support | |
function post(path, parameters) { | |
var form = $('<form></form>'); | |
form.attr("method", "post"); | |
form.attr("action", path); | |
$.each(parameters, function(key, value) { | |
if ( typeof value == 'object' || typeof value == 'array' ){ | |
$.each(value, function(subkey, subvalue) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Throttles duplicate requests. | |
/// Based loosely on <see href="http://stackoverflow.com/a/21011273/427899"/> | |
/// </summary> | |
public sealed class AsyncDuplicateLock | |
{ | |
/// <summary> | |
/// The collection of semaphore slims. | |
/// </summary> | |
private static readonly ConcurrentDictionary<object, SemaphoreSlim> SemaphoreSlims |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "#### Starting" | |
echo "#### apt-get updating and installing" | |
sudo apt-get update | |
sudo apt-get install screen libexpat1-dev libicu-dev git build-essential curl software-properties-common python-software-properties -y | |
echo "#### Installing node" | |
# Node | |
. ~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This script will increment the build number in an AssemblyInfo.cs file | |
# | |
$assemblyInfoPath = "C:\Data\Temp\AssemblyInfo.cs" | |
$contents = [System.IO.File]::ReadAllText($assemblyInfoPath) | |
$versionString = [RegEx]::Match($contents,"(AssemblyFileVersion\("")(?:\d+\.\d+\.\d+\.\d+)(""\))") | |
Write-Host ("AssemblyFileVersion: " +$versionString) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Copied from Hendy https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/72814-creating-a-list-of-unused-doc-types#comment-233729 | |
-- Find all unused docTypes | |
-- These results may contain docTypes that are masters of used ones, so need to exclude these too... | |
SELECT | |
A.nodeId as 'DocTypeId', | |
B.text AS 'Name', | |
A.alias AS 'Alias' | |
FROM | |
cmsContentType A LEFT JOIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Umbraco.Core; | |
using Umbraco.Core.Services; | |
using Umbraco.Web.Mvc; | |
using Umbraco.Web.Routing; | |
namespace Our.Umbraco | |
{ | |
public class MyApplication : ApplicationEventHandler | |
{ | |
protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) |
NewerOlder