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
-- 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, -6, getdate()) | |
print '==================================================' | |
print 'CreatedDate: ' + CAST(@createdDate AS VARCHAR) | |
print '==================================================' | |
print '' | |
print '' |
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
print '==================================================' | |
print 'delete recycle bin' | |
print '==================================================' | |
DELETE FROM cmsPreviewXml WHERE nodeId IN (SELECT id FROM umbracoNode WHERE path LIKE '%-20%' AND id!=-20); | |
DELETE FROM cmsContentVersion WHERE ContentId IN (SELECT id FROM umbracoNode WHERE path LIKE '%-20%' AND id!=-20); |
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
SELECT | |
t.NAME AS TableName, | |
s.Name AS SchemaName, | |
p.rows AS RowCounts, | |
SUM(a.total_pages) * 8 AS TotalSpaceKB, | |
SUM(a.used_pages) * 8 AS UsedSpaceKB, | |
(SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB | |
FROM sys.tables t | |
INNER JOIN sys.indexes i ON t.OBJECT_ID = i.object_id | |
INNER JOIN sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id |
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
DECLARE @Nodes TABLE (NodeId int) | |
INSERT INTO @Nodes (NodeId) | |
SELECT n.id | |
FROM cmsContent C | |
INNER JOIN cmsContentType CT ON C.contentType = CT.nodeId | |
INNER JOIN umbracoNode N ON C.nodeId = N.id | |
WHERE CT.alias = 'Twitter' OR CT.alias = 'Instagram' OR CT.alias = 'SocialPost' | |
delete from cmsPreviewXml where nodeId in (select NodeId from @Nodes) |
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 Newtonsoft.Json; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Mvc; | |
using Umbraco.Core; | |
using Umbraco.Core.Logging; | |
using Umbraco.Core.Models; | |
using Umbraco.Core.Models.Membership; |
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
select cpd.contentNodeId, datalength(cpd.dataNtext) as size from cmsPropertyData cpd order by size desc |
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
// usage: "nameTemplate": "{{ text | stripHtml }}" | |
(function () { | |
var tagBody = '(?:[^"\'>]|"[^"]*"|\'[^\']*\')*'; | |
var tagOrComment = new RegExp( | |
"<(?:" | |
// Comment body. | |
+ "!--(?:(?:-*[^->])*--+|-?)" |
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 System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Linq; | |
using System.Reflection; | |
namespace Helpers | |
{ | |
public class EnumHelpers | |
{ |
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 static class HtmlStringExtensions | |
{ | |
public static bool IsNullOrWhiteSpace(this IHtmlString htmlString) | |
{ | |
return htmlString == null || string.IsNullOrWhiteSpace(htmlString.ToHtmlString()); | |
} | |
public static HtmlString AddClass(this IHtmlString html, string css) | |
{ | |
return html.UpdateElement(node => node.AddClass(css)); |
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 XmlSitemap : IHttpHandler | |
{ | |
public bool IsReusable => false; | |
private static readonly XNamespace xmlns = "http://www.sitemaps.org/schemas/sitemap/0.9"; | |
public void ProcessRequest(HttpContext context) | |
{ | |
string language = context.Request?.QueryString["language"]?.ToFriendlyUrlFormat(); |
OlderNewer