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
jQuery(function($) { | |
$('form[data-async]').live('submit', function(event) { | |
var $form = $(this); | |
var $target = $($form.attr('data-target')); | |
$.ajax({ | |
type: $form.attr('method'), | |
url: $form.attr('action'), | |
data: $form.serialize(), |
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
// Setup CSRF safety for AJAX: | |
$.ajaxPrefilter(function(options, originalOptions, jqXHR) { | |
if (options.type.toUpperCase() === "POST") { | |
// We need to add the verificationToken to all POSTs | |
var token = $("input[name^=__RequestVerificationToken]").first(); | |
if (!token.length) return; | |
var tokenName = token.attr("name"); | |
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
namespace UmbracoBootstrap.Infrastructure.Extensions | |
{ | |
#region Using | |
using System.Diagnostics.CodeAnalysis; | |
#endregion | |
/// <summary> | |
/// Encapsulates a series of time saving extension methods to <see cref="T:System.String">String</see>s. | |
/// </summary> | |
public static class StringExtensions |
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) |
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
# | |
# 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
#!/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
/// <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
// 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
public class DefaultController : RenderMvcController | |
{ | |
[UmbracoDonutOutputCache(CacheProfile = "LongPageCache", | |
Options = OutputCacheOptions.NoCacheLookupForPosts & | |
OutputCacheOptions.ReplaceDonutsInChildActions, Order = 100)] | |
public override ActionResult Index(RenderModel model) | |
{ | |
return base.Index(model); | |
} | |
} |
OlderNewer