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
substitutions: | |
device_name: crawl_south | |
display_name: Crawl South | |
esphome: | |
name: $device_name | |
platform: ESP8266 | |
board: d1_mini_lite | |
wifi: |
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.CodeDom.Compiler; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Microsoft.CSharp; | |
namespace BbbAsmTest |
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
$(document).ajaxError(function (xhr, props) { | |
if (props.status === 401) { | |
location.reload(); | |
} | |
}); |
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
protected void Application_EndRequest() | |
{ | |
var context = new HttpContextWrapper(this.Context); | |
// If we're an ajax request and forms authentication caused a 302, | |
// then we actually need to do a 401 | |
if (FormsAuthentication.IsEnabled && context.Response.StatusCode == 302 | |
&& context.Request.IsAjaxRequest()) | |
{ | |
context.Response.Clear(); |
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 BundleConfig | |
{ | |
public static void RegisterBundles(BundleCollection bundles) | |
{ | |
var less = new Bundle("~/bundles/less") | |
.Include("~/less/bootstrap.less") | |
.Include("~/less/datepicker.less") | |
less.Transforms.Add(new LessTransform()); | |
less.Transforms.Add(new CssMinify()); | |
bundles.Add(less); |
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 LessTransform : IBundleTransform | |
{ | |
public void Process(BundleContext context, BundleResponse response) | |
{ | |
DotlessConfiguration config = new DotlessConfiguration(); | |
config.MinifyOutput = false; | |
config.ImportAllFilesAsLess = true; | |
config.CacheEnabled = false; | |
config.LessSource = typeof(VirtualFileReader); | |
#if DEBUG |
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
internal sealed class VirtualFileReader : IFileReader | |
{ | |
public byte[] GetBinaryFileContents(string fileName) | |
{ | |
fileName = GetFullPath(fileName); | |
return File.ReadAllBytes(fileName); | |
} | |
public string GetFileContents(string fileName) | |
{ |
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.Optimization; | |
public class LessTransform : IBundleTransform | |
{ | |
public void Process(BundleContext context, BundleResponse response) | |
{ | |
response.Content = dotless.Core.Less.Parse(response.Content); | |
response.ContentType = "text/css"; | |
} | |
} |