Skip to content

Instantly share code, notes, and snippets.

// Just do this : (and include backbone.js)
var Kind = function() {
this.initialize && this.initialize.apply(this, arguments);
};
Kind.extend = Backbone.Model.extend
//Simpler
var Thing = function() {};
Thing.extend = Backbone.Model.extend

###Expose IIS or IISExpress running in a Parallels Windows 7/8 VM to your OS X host

####Rename your virtual machine In your Windows 7/8 VM, go to Control Panel > System > Advanced system settings > Computer Name and click Change. Name this whatever you like, e.g. windows. Restart your VM.

####Add an ACL rule Open CMD or Powershell as administrator. Add a URL ACL entry for your new name on the port of your choice, e.g.
netsh http add urlacl url=http://windows:8080/ user=everyone

####Add a firewall rule

internal class TokenValidationHandler : DelegatingHandler
{
// This function retrieves ACS token (in format of OAuth 2.0 Bearer Token type) from
// the Authorization header in the incoming HTTP request from the client.
private static bool TryRetrieveToken(HttpRequestMessage request, out string token)
{
try
{
token = null;
IEnumerable<string> authHeaders;