Skip to content

Instantly share code, notes, and snippets.

@sucreations
sucreations / cancel.bat
Created February 9, 2013 19:04
To cancel the shutdown
shutdown -a
@sucreations
sucreations / shutdown15.bat
Last active December 12, 2015 08:49
Shutdown the PC after 15 min
//Shutdown the PC after 15 min;
shutdown -s -t 900
@sucreations
sucreations / resetcss.cs
Last active March 21, 2018 22:13
Reset CSS cache by forcing CSS files to refresh when using ASP.NET Themes
protected override void OnPreRender(System.EventArgs e)
{
//loop through all the controls
foreach (Control oLink in Page.Header.Controls){
if (oLink is HtmlLink){
HtmlLink cssLink = oLink as HtmlLink;
//Check if CSS link
if (cssLink.Attributes["type"].Equals("text/css", StringComparison.CurrentCultureIgnoreCase)){
if (cssLink.Attributes["href"].Contains(String.Format("~/App_Themes/{0}/", Page.Theme))){
//add a version of your app here.
function IsInputElement() {
var i = document.createElement("input");
i.setAttribute("type", "color");
return i.type !== "text";
}
function IsBaselineVideo() {
if (!supports_video()) { return false; }
var v = document.createElement("video");
return v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');
}
function IsCanvas() {
return !!document.createElement('canvas').getContext;
}
function IsGeolocation() {
return 'geolocation' in navigator;
}