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 (ko, handlers, unwrap, extend) { | |
"use strict"; | |
extend(handlers, { | |
href: { | |
update: function (element, valueAccessor) { | |
handlers.attr.update(element, function () { | |
return { href: valueAccessor() }; | |
}); | |
} | |
}, |
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; | |
public static class DateTimeExtensions | |
{ | |
public static string ToPrettyPast(this DateTime d) | |
{ | |
var timeSpan = DateTime.Now.Subtract(d); | |
if (timeSpan.Days == 1) | |
return "Yesterday."; |
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
/*-------------------------------------------------------------------------- | |
* linq.js - LINQ for JavaScript | |
* ver 2.2.0.2 (Jan. 21th, 2011) | |
* | |
* created and maintained by neuecc <ils@neue.cc> | |
* licensed under Microsoft Public License(Ms-PL) | |
* http://neue.cc/ | |
* http://linqjs.codeplex.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
// Knockout ObservableArray extension that will transform an array | |
// into a multidimension array (or columns) while still maintaining | |
// sort direction from left to right so that: [1, 2, 3, 4, 5, 6, 7] | |
// becomes [ [1, 4, 7], [2, 5], [3, 6] ] with 3 columns. | |
// | |
// fiddler demo: | |
// http://jsfiddle.net/harboe/RGBdq/16/ | |
ko.observableArray.fn.toColumn = function(data, numberOfColumns) { | |
var generateColumns = function(data, numberOfColumns) { |
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.Collections.Generic; | |
using System.Linq; | |
using System.Web.Http; | |
using System.Web.Http.Tracing; | |
using System.Net.Http.Formatting; | |
public static class WebApiConfig | |
{ | |
public static void Register(HttpConfiguration config) |
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.Text; | |
using System.Xml.Linq; | |
public static class XElementExtension | |
{ | |
public static string InnerXml(this XContainer element) | |
{ | |
var innerXml = new StringBuilder(); |
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.Permissions; | |
using System.Runtime.Serialization; | |
/// <summary> | |
/// Generic implementation of the <c>System.EventArgs</c> the base class for | |
/// classes containing event data. | |
/// </summary> | |
[Serializable] | |
public class EventArgs<TData> : EventArgs, ISerializable |
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(undefined) { | |
// custom binding handle for simplifying the search | |
// input text. | |
// | |
// usage: data-bind="search: viewModelCallbackFunction" | |
// | |
// 1. It will clear all the content when the user hits esc. | |
// 2. There is a timer that will auto sumbit. | |
// 3. Manually submit thought the Enter key |
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.Collections.Generic; | |
using System.Collections.Specialized; | |
using System.Linq; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using System.Threading.Tasks; | |
public static class ArgumentParser | |
{ |
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.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Web.Http.Controllers; | |
using System.Web.Http.Filters; | |
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] | |
public class ValidateModelStateAttribute : ActionFilterAttribute | |
{ |
NewerOlder