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
// jquery.jqax.js - A plugin for jQuery ajax wrapping some common | |
// functionality aimed at .NET services and page methods | |
// Ben Cull - 18 August 2010 | |
(function($) { | |
$.jQax = function(options) { | |
// Load Defaults and make them public | |
this.defaults = { | |
ShowLoading: true, |
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
/****** Object: UserDefinedFunction [dbo].[SplitQuoteSafe] Script Date: 09/13/2010 16:57:17 ******/ | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
-- SELECT * FROM dbo.SplitQuoteSafe('"Test","Stuff, that, has commas","ok",24.45,,yes', ',') | |
CREATE FUNCTION [dbo].[SplitQuoteSafe] | |
( | |
@RowData nvarchar(2000), | |
@SplitOn nvarchar(5) |
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
/// ASP.NET MVC 3 Credit Card Validator Attribute | |
/// by Ben Cull - 4 November 2010 | |
/// | |
/// With special thanks to: | |
/// Thomas @ Orb of Knowledge - http://orb-of-knowledge.blogspot.com/2009/08/extremely-fast-luhn-function-for-c.html | |
/// For the Extremely fast Luhn algorithm implementation | |
/// | |
/// And Paul Ingles - http://www.codeproject.com/KB/validation/creditcardvalidator.aspx | |
/// For a timeless blog post on credit card validation |
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
namespace BenjiiMe.Animation | |
{ | |
public class ContinuumTransition : TransitionElement | |
{ | |
public const string ContinuumElementPropertyName = "ContinuumElement"; | |
public const string ContinuumModePropertyName = "Mode"; | |
public FrameworkElement ContinuumElement | |
{ | |
get { return (FrameworkElement)GetValue(ContinuumElementProperty); } |
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 static class ExcelExtensions | |
{ | |
public static FileStreamResult ToDownloadableXmlFileForExcel2003(this System.Xml.Linq.XDocument file, string fileName) | |
{ | |
MemoryStream ms = new MemoryStream(); | |
file.Save(ms); //.Save() adds the <xml /> header tag! | |
ms.Seek(0, SeekOrigin.Begin); | |
var r = new FileStreamResult(ms, "application/vnd.ms-excel"); |
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
<?xml version="1.0" encoding="utf-8"?> | |
<CodeSnippets | |
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>Property with Notify Snippet</Title> | |
<Author>Ben Cull - http://benjii.me</Author> | |
<Description>Inserts a full property with a NotifyOfPropertyChange statement as well. To be used with the Caliburn.Mircro library.</Description> | |
<Shortcut>propnfy</Shortcut> | |
</Header> |
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
var QuickEvent = function () { | |
var nextSubscriberId = 0; | |
var subscriberList = []; | |
var subscribe = function (callback) { | |
var id = nextSubscriberId; | |
subscriberList[id] = callback; | |
nextSubscriberId++; | |
return id; | |
}; |
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 HttpsServiceHostFactory : ServiceHostFactory | |
{ | |
protected override System.ServiceModel.ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses) | |
{ | |
ServiceHost host = new ServiceHost(serviceType, baseAddresses); | |
foreach (Uri baseAddress in baseAddresses) | |
{ | |
BasicHttpBinding binding = CreateSoapBinding(baseAddress); |
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 HttpsWebServiceHostFactory : WebServiceHostFactory | |
{ | |
protected override System.ServiceModel.ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses) | |
{ | |
WebServiceHost host = new WebServiceHost(serviceType, baseAddresses); | |
foreach (Uri baseAddress in baseAddresses) | |
{ | |
WebHttpBinding binding = CreateRestBinding(baseAddress); | |
ServiceEndpoint endpoint = host.AddServiceEndpoint(serviceType.GetInterfaces()[0], binding, baseAddress); |
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 WordDocumentAttribute : ActionFilterAttribute | |
{ | |
public string DefaultFilename { get; set; } | |
public override void OnActionExecuted(ActionExecutedContext filterContext) | |
{ | |
var result = filterContext.Result as ViewResult; | |
if (result != null) | |
result.MasterName = "~/Views/Shared/_LayoutWord.cshtml"; |
OlderNewer