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
| // An example of how to work with an array in a non-blocking | |
| // loop. | |
| // This will store our results. | |
| var result = { | |
| count: 0, | |
| sum: 0, | |
| toString: function () { | |
| return "Count: " + result.count + ", Sum: " + result.sum; | |
| } |
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 interface IWhateverDataTableProvider | |
| { | |
| DataTable GetData(); | |
| } | |
| public class WhateverDataTableProvider : IWhateverDataTableProvider | |
| { | |
| public DataTable GetData() | |
| { | |
| // put all that hard-coded, hard to test stuff here... |
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 HtmlHelpers | |
| { | |
| public static IHtmlString ArrayCheckBoxFor<TModel, TArray>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TArray[]>> expression, TArray value) | |
| { | |
| ModelMetadata metadata = ModelMetadata.FromLambdaExpression(expression, htmlHelper.ViewData); | |
| var tagBuilder = new TagBuilder("input"); | |
| tagBuilder.Attributes.Add("type", "checkbox"); | |
| tagBuilder.Attributes.Add("name", metadata.PropertyName); | |
| tagBuilder.Attributes.Add("value", value.ToString()); |
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
| // We are creating a new class definition. The class definition itself | |
| // will be added to the global window object. | |
| window.MultiSelect = (function() { | |
| function MultiSelect(options) { | |
| var defaults = { | |
| checkboxSelector: ".multi-select-checkbox", | |
| onSelector: ".multi-select-on", | |
| selectAllSelector: "#multi-select-all" | |
| }; |
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
| // Using Modernizr to detect and then apply a datepicker to date objects. | |
| // Instead of creating a new instance of a JavaScript class, this is | |
| // using an object literal. | |
| // | |
| // Usage: DatePickers.initialize(); This would either be called from the | |
| // bottom of your page (after any date pickers) or from inside a jQuery | |
| // document ready clause. | |
| // | |
| // Options: | |
| // extension: The name of the extension to create/initialize the date |
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
| (function () { | |
| var defaults = { | |
| message: "Waiting...", | |
| selector: ".text-selector" | |
| } | |
| window.thing = { | |
| initialize: function (opts) { |
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
| PATH | |
| %WINDOWS_PATH%;%SQL_SERVER_PATH%;%VISUAL_STUDIO_PATH%;%GIT_PATH%;%NODEJS_PATH%;%DEVTOOLS_PATH% | |
| WINDOWS_PATH | |
| C:\Windows;C:\Windows\system32;C:\Windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\ | |
| SQL_SERVER_PATH | |
| C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\ |
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
| using System; | |
| using System.Diagnostics.Contracts; | |
| using System.Web.Http.Dependencies; | |
| using Ninject; | |
| using Ninject.Activation.Blocks; | |
| namespace MyProject | |
| { | |
| public class NinjectDependencyResolver : NinjectDependencyScope, IDependencyResolver | |
| { |
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 ConversionStrategy = (function () { | |
| function ConversionStrategy() { | |
| } | |
| ConversionStrategy.prototype.valueOf = function (value) { | |
| return -1; | |
| }; | |
| return ConversionStrategy; |
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 StrategyQuery | |
| { | |
| public string Name { get; set; } | |
| } | |
| public interface IStrategy | |
| { | |
| bool CanHandle(StrategyQuery query); | |
| void DoSomething(); | |
| } |