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 System; | |
using System.Web.Mvc; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Converters; | |
public static class HtmlHelperExtensions { | |
/// <summary> | |
/// Dumps a JSON object to a view, in javascript format rather than as a string | |
/// </summary> |
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 System; | |
using System.Security.Principal; | |
namespace Microsoft.AspNet.Identity { | |
public static class IIdentityExt { | |
public static Guid GetGuid(this IIdentity identity) { | |
var result = Guid.Empty; |
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 System; | |
namespace Microsoft.Owin { | |
public static class OwinRequestExt { | |
/// <summary> | |
/// Really basic method for calculating if a request is an ajax/data request | |
/// </summary> | |
public static bool IsAjaxRequest(this IOwinRequest request) { |
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 System.Web; | |
namespace System.Net.Http { | |
public static class HttpRequestMessageExt { | |
/// <summary> | |
/// Returns the Clients Ip Address from the Request message | |
/// | |
/// Note: Use owin context version Request.GetOwinContext().Request.RemoteIpAddress (owin context can also be retrieved from (OwinContext)request.Properties["MS_OwinContext"] |
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
/*jslint browser: true, white: true */ | |
/*global define, window */ | |
;(function(factory) { | |
"use strict"; | |
// simply the dependanices required for this module pass in either required module names or the raw objects if amd not found | |
if (typeof define === 'function' && define['amd']) { | |
define([], factory); |
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
/// <summary> | |
/// To get round the issue of a try/catch/finally being disrupted by transfer and redirection, fill the details of the redirection in this class and run at the end of finally if not null. | |
/// </summary> | |
public class Redirection | |
{ | |
public enum TransferType | |
{ | |
Redirect, | |
Transfer | |
} |
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
/** | |
* An extension to JQuery that returns the actual column position of the table cell regardless of columns hvaing a colspan | |
* | |
* returns column index (zerobased) | |
* | |
* Based on code from SolutionYogi on stackoverflow | |
* http://stackoverflow.com/questions/1166452/finding-column-index-using-jquery-when-table-contains-column-spanning-cells | |
*/ | |
(function($) { |
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
DECLARE @name VARCHAR(50) -- database name | |
DECLARE db_cursor CURSOR FOR | |
SELECT name | |
FROM master.dbo.sysdatabases | |
where DATABASEPROPERTYEX(name, 'Status') = 'OFFLINE' | |
ORDER BY 1 | |
OPEN db_cursor | |
FETCH NEXT FROM db_cursor INTO @name |
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 System.Linq; | |
using Newtonsoft.Json; | |
using RazorEngine.Configuration; | |
using RazorEngine.Templating; | |
using System.IO; | |
using System.Net; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Text.RegularExpressions; | |
using System.Threading; |
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(){"use strict;";function e(e){var t=this,n=e.eventName||e.type;if(t.fireEvent&&r["on"+n])t.fireEvent("on"+n,e);else if(t[n]&&"function"==typeof t[n])t[n](e);else if(t["on"+n]&&"function"==typeof t["on"+n])t["on"+n](e);else for(var a=0,p=o.length;p>a;a++){var i=o[a];if(this===i.object&&i.type===e.eventName){i.wrapper.call(t,e);break}}}function t(e,t){var n=this,r=function(e){e.target=e.srcElement,e.currentTarget=n,t.handleEvent?t.handleEvent(e):t.call(n,e)};if("DOMContentLoaded"==e){var a=function(e){"interactive"===document.readyState&&r(e)};/interactive|complete|loaded/.test(document.readyState)||(document.attachEvent("onreadystatechange",a),o.push({object:n,type:e,listener:t,wrapper:a}))}else n.attachEvent("on"+e,r),o.push({object:n,type:e,listener:t,wrapper:r})}function n(e,t){for(var n=0;n<o.length;){var r=o[n];if(r.object==this&&r.type==e&&r.listener==t){var a="DOMContentLoaded"===e?"onreadystatechange":"on"+e;this.detachEvent(a,r.wrapper);break}++n}}if(Event.prototype.preventDefault||(Event.pr |
OlderNewer