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.Net; | |
using System.Threading.Tasks; | |
using Xunit; | |
public class Fixture | |
{ | |
[Fact] | |
public void Should_FactMethodName() |
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.Text; | |
using Nancy; | |
using Nancy.Testing; | |
using Nancy.Testing.Fakes; | |
using Xunit; | |
using Xunit.Extensions; |
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
public static class BootstrapperExtensions | |
{ | |
public static void WithSession(this IPipelines pipeline, IDictionary<string, object> session) | |
{ | |
pipeline.BeforeRequest.AddItemToEndOfPipeline(ctx => | |
{ | |
ctx.Request.Session = new Session(session); | |
return null; | |
}); | |
} |
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
<configuration> | |
<system.webServer> | |
<handlers> | |
<add name="iisnode" path="app.js" verb="*" modules="iisnode" /> | |
</handlers> | |
<iisnode loggingEnabled="false" debuggingEnabled="true" debuggerPathSegment="debug" /> | |
<rewrite> | |
<rules> | |
<clear /> | |
<rule name="Debug" patternSyntax="Wildcard" stopProcessing="true"> |
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
[NonAction] | |
protected ActionResult WrapDataTableQuery<T>(IQueryable<T> data, Func<string, Expression<Func<T, bool>>> filter, Func<IQueryable<T>, string, bool, IOrderedQueryable<T>> applyOrderingFunction, Func<T, object[]> decorator) | |
{ | |
// Fetch query parameters from the form buffer. All queries are POSTs | |
var queryData = ParseDataTableQueryDetails(); | |
if (!String.IsNullOrWhiteSpace(queryData.SearchTerm)) | |
{ | |
data = data.Where(filter(queryData.SearchTerm.ToLower())); | |
} |
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 createPerson(name) { | |
var _name = name; | |
return { | |
sayHello: function () { | |
console.log("Hello " + _name); | |
} | |
} | |
} | |
var sue = createPerson('sue'); | |
var bill = createPerson('bill'); |
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
// Person.js | |
(function () { | |
var Person = WinJS.Class.define(function (name) { | |
this.name = name; | |
}, { | |
sayHello: function () { | |
console.log("Hello " + this.name); | |
} | |
}, { | |
createPerson: function (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
var Person = (function() { | |
var ctor = function(name) { | |
var _name = name; | |
this.get_name = function() { return _name; } // Wrap the private variable with a getter | |
}; | |
ctor.prototype.sayHello = function () { | |
console.log("Hello " + this.get_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
var Person = function (name) { | |
this.name = name; | |
}; | |
Person.prototype.sayHello = function () { | |
console.log("Hello " + this.name); | |
} | |
var sue = new Person('sue'); | |
sue.sayHello(); // prints Hello sue | |
var bill = new Person('bill'); |
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 createPerson(name) { | |
return { | |
name: name, | |
sayHello: function () { | |
console.log("Hello " + this.name); | |
} | |
} | |
} | |
var sue = createPerson('sue'); | |
var bill = createPerson('bill'); |