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
// Checks an element to see if the validation says it is required | |
// and if so, adds a '*' to the label using the 'for' semantic attribute. | |
function MarkAsRequired(element) { | |
var req = $(element).attr('data-val-required'); | |
if (undefined != req) { | |
var label = $('label[for="' + $(element).attr('id') + '"]'); | |
var text = label.text(); | |
if (text.length > 0) { | |
label.append('<span style="color:red"> *</span>'); | |
} |
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
$("#textboxId").keyup(function (event) { | |
if (event.keyCode == 13) { | |
$("#sendId").click(); | |
} | |
}); |
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
<!-- This is added under your WebRole section. The commandline should be the path to the file, which starts at the root of the project that is your WebRole. --> | |
<Startup> | |
<Task commandLine="startup\disableTimeout.cmd" executionContext="elevated" taskType="background"/> | |
</Startup> |
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
@model System.Web.Mvc.HandleErrorInfo | |
@{ | |
ViewBag.Title = "Error"; | |
} | |
<h2> | |
Sorry, an error occurred while processing your request. | |
</h2> |
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
@ECHO OFF | |
SETLOCAL | |
SET VERSION=%1 | |
SET NUGET=.\BuildAndPackageSupport\nuget.exe | |
FOR /r %%f IN (*.nuspec) DO ( | |
echo "packing..." | |
%NUGET% pack %%f -Version %VERSION% | |
) |
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
// This script sends an email using ScriptCS. | |
// Useful as an isolated, easy to configure email sender to debug SMTP | |
// issues that may be hard/impossible by running your production application | |
// over and over just to send an email. | |
// More Info: http://scriptcs.net/ | |
using System.Net.Mail; | |
string from = "from@address.com"; | |
string to = "to@address.com"; |
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
<!-- | |
This javascript code will find the logout form on your page and do the submit. | |
We do this separation so we can have total control over styling. | |
--> | |
<a href="javascript:document.getElementById('logoutForm').submit()">Logout!</a> | |
<!-- | |
Put this form anywhere you want outside your content area so styling isn't jacked up. | |
--> | |
@using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-form pull-right" })) |
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
var inFocus = true; | |
$(window).blur(function(){ | |
inFocus = false; | |
}); | |
$(window).focus(function(){ | |
inFocus = true; | |
}); | |
setTimeout(function(){ | |
if (!inFocus) { |
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
function showNotification(title, body) { | |
var notification = new Notification(title, { body }); | |
notification.onclick = e => { | |
alert("Clicked!"); | |
}; | |
} | |
Notification.requestPermission(permission => { | |
console.log(permission); | |
if(permission==="granted") { |
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
#addin "nuget:?package=Cake.Watch" // Put this at the top to pull in the Cake.Watch package for use. | |
// Add this task in your build file somewhere. You can update which target to run, the file pattern to watch, and even the toast notification. | |
Task("Watch") | |
.Does(() => { | |
var settings = new WatchSettings { | |
Recursive = true, | |
Path = "./", | |
Pattern = "*.*" | |
}; |
OlderNewer