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, -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 |
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
-- set how many versions to keep using @numberOfVersionToKeep, this can be set to anything from 0 and above. 0 will clean all versions except the current of course. | |
-- actually delete stuff by modifying last line to 'commit tran' | |
begin tran | |
go | |
DECLARE @numberOfVersionToKeep int = 20 | |
IF OBJECT_ID('tempdb..#tmp') IS NOT NULL DROP Table #tmp | |
create table #tmp (versionid uniqueidentifier) |
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
/* | |
2018-12-06 | |
This SQL will remove all content and media that's in the recycle bin | |
Tested on: Umbraco 7.12.3 | |
NOTE: | |
You might want to empty the recycle bin in the media-section manually since the files on disk will not be deleted when executing this SQL-query. | |
PRO-TIP: Execute each line one by one by selecting the row and hit CTRL+E | |
*/ |
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.Web.Routing; | |
using Umbraco.Core; | |
namespace RemoveRoutes | |
{ | |
public class RemoveRoutesStartupHandler : ApplicationEventHandler | |
{ | |
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) | |
{ | |
// Reference: https://github.com/umbraco/Umbraco-CMS/issues/5206 |
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
# statup umbraco, and add some packages if you want | |
# | |
# e.g numbraco MyTestSite uSync Jumoo.TranslationManager vendr -NoStarter | |
# | |
# extras!!! | |
# | |
# open vscode in the folder as part of the build | |
# numbraco MyTestSite -code | |
# | |
# don't run the site |