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
/* | |
A quick sample of the module pattern from JavaScript Patterns | |
*/ | |
var app = app || {}; | |
app.module = (function(){ | |
// private members | |
var prop = 0; | |
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 StructureMap.Configuration.DSL; | |
using StructureMap.Graph; | |
namespace TransCore.FMWebMobile.DependencyResolution | |
{ | |
internal class ControllerRegistryConvention : IRegistrationConvention | |
{ | |
public void Process(Type type, Registry registry) |
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; | |
namespace NewInMVC3.ModelBinder | |
{ | |
public class GenericModelBinderProvider : IModelBinderProvider | |
{ | |
public IModelBinder GetBinder(Type modelType) | |
{ | |
var genericType = typeof (IModelBinder<>).MakeGenericType(modelType); |
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
Given that I am a logged in user | |
And I have clicked on the Spot Market Tab | |
And I have subscribed as a Combo Pro Contributor or Combo Premium Contributor | |
When I Enter the <insert prompt names> | |
Or enter Lookback options of 7,15,60,90 days or 1 year | |
Or enter geography options of 3 digit zip, market, area, region | |
And click “Get Rates” button | |
Then Avg Linehal should display the calculated figure |
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
abstract class BaseViewModel : IValidatable { | |
public LocationViewModel Origin { get; set;} | |
public LocationViewModel Dest { get; set; } | |
override IEnumerable<ValidationResult> Validate( ValidationContext context ) { | |
//copy ValidateFMViewModel logic | |
} | |
protected abstract LocationsCheckResult Check(string originToCheck, string destToCheck); |
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
this.Origin = new LocationViewModel | |
{ | |
RawValue = | |
TransCore.WebApis.Client.Fluency.Locations.Places.Get(search.Criteria.From). | |
DisplayText | |
}; | |
} |
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; | |
namespace TransCore.FMWebMobile.DeviceRedirect | |
{ | |
public class DeviceRedirectModule : IHttpModule | |
{ | |
const string COOKIE_NAME = "FMWebFullSite"; | |
private const string MOBILE_PATH = "/m"; |
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
// Print all of the news items on hackernews | |
var jsdom = require('jsdom'); | |
jsdom.env({ | |
html: 'http://news.ycombinator.com/', | |
scripts: [ | |
'http://code.jquery.com/jquery-1.5.min.js' | |
], | |
done: function(errors, window) { | |
var $ = window.$; |
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
// example using the raf module from npm. try changing some values! | |
var requestAnimationFrame = require("raf") | |
var canvas = document.createElement("canvas") | |
canvas.width = 500 | |
canvas.height = 500 | |
document.body.appendChild(canvas) | |
var context = canvas.getContext("2d") |
OlderNewer