This file contains hidden or 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 ContextMocker | |
{ | |
public ContextMocker(string [] qKeys = null) | |
{ | |
ILogger loggerMock = Mock.Of<ILogger>(); | |
IProfiler profilerMock = Mock.Of<IProfiler>(); | |
var contextBaseMock = new Mock<HttpContextBase>(); | |
if (qKeys != null) | |
{ | |
var requestMock = new Mock<HttpRequestBase>(); |
This file contains hidden or 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
<div ng-controller="Umbraco.PropertyEditors.ColorPickerController"> | |
<ul class="thumbnails color-picker"> | |
<li ng-repeat="preval in model.prevalues" ng-class="{active: model.value === preval}"> | |
<a ng-click="toggleItem(preval)" class="thumbnail" hex-bg-color="{{preval}}"> | |
</a> | |
</li> | |
</ul> | |
<input type="hidden" name="modelValue" ng-model="model.value" val-property-validator="validateMandatory"/> | |
</div> |
This file contains hidden or 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 RssActionResult : ActionResult | |
{ | |
public SyndicationFeed Feed { get; set; } | |
public override void ExecuteResult(ControllerContext context) | |
{ | |
context.HttpContext.Response.ContentType = "application/rss+xml"; | |
var rssFormatter = new Rss20FeedFormatter(Feed); | |
using (var writer = XmlWriter.Create(context.HttpContext.Response.Output)) | |
{ |
This file contains hidden or 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
static void Main(string[] args) | |
{ | |
int[] input = new int[] {3, 8, 9, 7, 6}; | |
int k = 3; | |
solution(input, k); | |
} | |
public static int[] solution(int[] input, int times) | |
{ | |
var r = new int[input.Length]; |
This file contains hidden or 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
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage | |
@using System.Linq; | |
@{ | |
Layout = null; | |
Response.ContentType = "text/xml"; | |
}<?xml version='1.0' encoding='UTF-8' ?> | |
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> | |
@ListChildNodes(Umbraco.TypedContent(UmbracoContext.Current.PageId).AncestorOrSelf(1)) |
This file contains hidden or 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 CustomEventHandler : ApplicationEventHandler | |
{ | |
protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) | |
{ | |
ViewEngines.Engines.Clear(); | |
ViewEngines.Engines.Add(new RenderViewEngine()); | |
} | |
} | |
} |
This file contains hidden or 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
<div ng-controller="Umbraco.PropertyEditors.ColorPickerController"> | |
<ul class="thumbnails color-picker"> | |
<li ng-repeat="preval in model.prevalues" ng-class="{active: model.value === preval}"> | |
<a ng-click="toggleItem(preval)" class="thumbnail" hex-bg-color="{{preval}}"> | |
</a> | |
</li> | |
</ul> | |
<input type="hidden" name="modelValue" ng-model="model.value" val-property-validator="validateMandatory"/> | |
</div> |
This file contains hidden or 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 Autofac; | |
using Autofac.Integration.Mvc; | |
using Autofac.Integration.WebApi; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Optimization; | |
using MyApp.Services; | |
using MyApp.Services.Interfaces; |
This file contains hidden or 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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Umbraco.Web.Routing; | |
namespace Diplo.Core | |
{ | |
/// <summary> |
This file contains hidden or 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
-- Umbraco Clear Old Document Versions To Decrease Database Size And Improve Performance | |
-- http://borism.net/2008/12/16/fixing-a-large-cmspropertydata-table-in-umbraco/ | |
DECLARE @createdDate Datetime = DATEADD(m, -1, getdate()) | |
-- dump logs | |
-- TRUNCATE TABLE umbracolog -- faster if log table is very big and you don't need anything | |
DELETE FROM umbracolog WHERE Datestamp < @createdDate | |
-- clean up old versions | |
DELETE FROM cmsPropertyData WHERE |
NewerOlder