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
const axios = require('axios'); | |
const FormData = require('form-data'); | |
/**********************************************************************/ | |
/* Convert a Base64 file to a buffer. | |
/**********************************************************************/ | |
const base64ToBuffer = (base64String, fileName) => { | |
if (base64String !== "") { | |
let buffer; | |
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
if (!Page.ClientScript.IsClientScriptBlockRegistered(this.GetType(), "MyWebpart")) | |
{ | |
string jsScripts = $@"$LAB | |
.script(""{CacheEngine.StaticFileCacheBuster("/resources/js/plugins/slick.min.js")}"") | |
.script(""{CacheEngine.StaticFileCacheBuster("/resources/js/carousel.min.js")}"").wait(function() {{ | |
BECarousel.Init(); | |
FECarousel.Init(); | |
}});"; | |
ScriptManager.RegisterStartupScript(this, typeof(string), "MyWebpart", jsScripts, true); |
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
<!-- Cache Bust CSS/Images --> | |
<link rel="stylesheet" type="text/css" href="{%"/resources/css/site.min.css".CacheBuster() #%}" /> | |
<link rel="apple-touch-icon" href="{%"/resources/images/icons/apple-touch-icon.png".CacheBuster()#%}" /> | |
<!-- Outcome --> | |
<link rel="stylesheet" type="text/css" href="/resources/css/v636619761520000000/site.min.css" /> | |
<link rel="apple-touch-icon" href="/resources/images/icons/v636528193180000000/apple-touch-icon.png" /> |
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 CMS; | |
using CMS.DocumentEngine; | |
using CMS.Helpers; | |
using CMS.MacroEngine; | |
using CMS.SiteProvider; | |
using System; | |
using System.Text; | |
using System.Web;[assembly: RegisterExtension(typeof(StringMacroMethods), typeof(string))] | |
public class StringMacroMethods : MacroMethodContainer | |
{ |
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
<system.webServer> | |
<rewrite> | |
<rules> | |
<rule name="Cache Buster"> | |
<match url="([\S]+)(/v[0-9]+/)([\S]+)" /> | |
<action type="Rewrite" url="{R:1}/{R:3}" /> | |
</rule> | |
</rules> | |
</rewrite> | |
<staticContent> |
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 CacheEngine | |
{ | |
/// <summary> | |
/// Caches static resources, such as CSS and JavaScript. | |
/// </summary> | |
/// <param name="rootRelativePath"></param> | |
/// <returns></returns> | |
public static string StaticFileCacheBuster(string rootRelativePath) | |
{ | |
if (!HttpContext.Current.IsDebuggingEnabled) |
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
<!-- Cache resources directory BEGIN --> | |
<location path="resources"> | |
<system.webServer> | |
<httpProtocol> | |
<customHeaders> | |
<add name="Cache-Control" value="public, max-age=604800" /> | |
</customHeaders> | |
</httpProtocol> | |
</system.webServer> | |
</location> |
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 CMS.DataEngine; | |
using CMS.DocumentEngine; | |
using CMS.Helpers; | |
using CMS.MediaLibrary; | |
using Export.BlogPosts.Models; | |
using ReverseMarkdown; | |
using System; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.IO; |
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 WebMarkupMinConfig | |
{ | |
public static void Configure(WebMarkupMinConfiguration configuration) | |
{ | |
configuration.AllowMinificationInDebugMode = false; | |
configuration.AllowCompressionInDebugMode = false; | |
configuration.DisablePoweredByHttpHeaders = true; | |
DefaultLogger.Current = new ThrowExceptionLogger(); |
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 HtmlAgilityPack; | |
using Site.Common.Kentico; | |
using System; | |
using System.Collections.Generic; | |
using System.Collections.Specialized; | |
using System.Linq; | |
using System.Text; | |
using System.Web; | |
namespace SurinderBhomra.Common.Extensions |