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
// uses Newtonsoft Json | |
var slideshareOembedUrl = "http://www.slideshare.net/api/oembed/2?url=" + urlToRender + "&maxwidth=800&maxheight=400&format=json"; | |
var wc = new WebClient(); | |
var json = wc.DownloadString(slideshareOembedUrl); | |
var jsonObject = JObject.Parse(json); | |
return jsonObject.Property("thumbnail").Value.ToString(); |
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 FileSize | |
{ | |
public static string FormatBytes(string bytes, int scale = 1024) | |
{ | |
long bytesNumber = Convert.ToInt64(bytes); | |
return FormatBytes(bytesNumber, scale); | |
} | |
public static string FormatBytes(long bytes, int scale = 1024) |
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.Web; | |
using System.Web.Mvc; | |
using Umbraco.Web.Models; | |
using Umbraco.Web.Mvc; | |
namespace Controllers | |
{ | |
/// <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
using System.Collections.Generic; | |
using System.Web; | |
using Newtonsoft.Json; | |
/// <summary> | |
/// Captcha helper | |
/// </summary> | |
/// <remarks> | |
/// Original http://stackoverflow.com/questions/27764692/validating-recaptcha-2-no-captcha-recaptcha-in-asp-nets-server-side | |
/// </remarks> |
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 old namespace to create Macro, since Umbraco.Core.Models.Macro is still an internal class in Umbraco V7.1.8 | |
var macro = new Macro.Macro { Alias = alias, Name = name, ScriptingFile = scriptingFile, UseInEditor = useInEditor, RenderContent = renderContent }; | |
macro.Save(); | |
var newMacro = Services.MacroService.GetByAlias(alias); | |
foreach (var macroProperty in macroProperties) | |
{ | |
newMacro.Properties.Add(macroProperty); | |
} | |
Services.MacroService.Save(newMacro); |
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
### Keybase proof | |
I hereby claim: | |
* I am dampee on github. | |
* I am damiaan (https://keybase.io/damiaan) on keybase. | |
* I have a public key whose fingerprint is 8916 1EB8 0874 7B83 C747 A50C 09B2 0515 7944 DF39 | |
To claim this, I am signing this object: |
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
[Test] | |
public void Delete_SortOrder_Is_Correct() | |
{ | |
// Arrange | |
var contentService = ServiceContext.ContentService; | |
var root = contentService.GetById(NodeDto.NodeIdSeed + 4); | |
var contentType = ServiceContext.ContentTypeService.GetContentType("umbTextpage"); | |
var contentList = CreateChildrenOf(contentType, root, 3); | |
contentService.Save(contentList); |
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.Web.Http; | |
using System.Collections.Generic; | |
using Umbraco.Core.Models; | |
using Umbraco.Web.WebApi; | |
namespace Our.Umbraco | |
{ | |
public class UpgradeHelperController : UmbracoAuthorizedApiController | |
{ | |
[HttpGet()] |
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 |
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
2016-02-15 14:52:56,906 [P1364/D2/T1] INFO Umbraco.Core.CoreBootManager - Umbraco 7.4.0 application starting on DESKTOP-JJOR4ST | |
2016-02-15 14:52:56,927 [P1364/D2/T1] INFO Umbraco.Core.PluginManager - Determining hash of code files on disk | |
2016-02-15 14:52:56,934 [P1364/D2/T1] INFO Umbraco.Core.PluginManager - Hash determined (took 7ms) | |
2016-02-15 14:52:56,973 [P1364/D2/T1] INFO Umbraco.Core.PluginManager - Starting resolution types of umbraco.interfaces.IApplicationStartupHandler | |
2016-02-15 14:52:57,129 [P1364/D2/T1] INFO Umbraco.Core.PluginManager - Completed resolution of types of umbraco.interfaces.IApplicationStartupHandler, found 0 (took 156ms) | |
2016-02-15 14:52:57,138 [P1364/D2/T1] INFO Umbraco.Core.PluginManager - Starting resolution types of Umbraco.Core.PropertyEditors.IPropertyEditorValueConverter | |
2016-02-15 14:52:57,145 [P1364/D2/T1] INFO Umbraco.Core.PluginManager - Completed resolution of types of Umbraco.Core.PropertyEditors.IPropertyEditorValueConverter, found 0 (took 6ms) | |
2016-02 |