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 dbClient; | |
var ensureDbClient = function(callback){ | |
if(dbClient){ | |
console.info('ensureDbClient: returning existing client'); | |
return callback(null, dbClient); | |
} else { | |
console.info('ensureDbClient: returning NEW client'); | |
MongoClient.connect(mongoConnectionString, mongoConnectionOptions, function(err, db){ | |
if(err){ | |
return callback(err, 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
var mapByOrgID = function(){ | |
var orgID = this.OrgID; | |
if(orgID) | |
emit(orgID, { ecosystem: this.ecosystem }); | |
}; | |
var reduceEcosystems = function(key, values){ | |
var ret = { | |
orgID: key, | |
ecosystems: [] |
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
// FROM THE SHELL | |
{ | |
"result" : "organizations_reduced_ecosystems", | |
"timeMillis" : 20827, | |
"counts" : { | |
"input" : 198751, | |
"emit" : 198740, | |
"reduce" : 26380, | |
"output" : 162220 |
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 bunyan = require('bunyan').createLogger({ | |
name: "foo", | |
streams: [ | |
{ | |
stream: process.stdout, | |
level: "trace" | |
} | |
] | |
}); |
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 class EtagMessageHandler : DelegatingChannel | |
{ | |
readonly IETagStore _eTagStore; | |
public EtagMessageHandler(HttpMessageChannel innerChannel) : base(innerChannel) { | |
Trace.WriteLine("EtagMessageHandler - Ctor"); | |
_eTagStore = new InMemoryETagStore(); | |
} |
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
Get-ChildItem $wcfsource -Exclude "*.StyleCop" -Recurse | %{Copy-Item $_.FullName -Destination ($hgroot + $_.FullName.Substring($wcfsource.Length)) -Force} |
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
Import-Module Pscx | |
# the variables you'll likely need to change on your local machine | |
$afroot = "D:\AppFabric" | |
$hgroot = 'D:\Programming Projects' | |
# $hgremote = "https://hg01.codeplex.com/wcf" | |
$hgremote = "D:\Programming Projects\wcf-codeplex-baseline_RC2" | |
# derived paths | |
$afwcfsource = $afroot + "\private\source\WCF" |
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
<?xml version="1.0" encoding="utf-8"?> | |
<xsl:stylesheet version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl b" | |
xmlns:b="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<xsl:output method="xml" indent="yes" encoding="UTF-8"/> | |
<xsl:template match="/b:Project"> | |
<xsl:copy> |
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
class MyCustomMediaTypeFormatter : MediaTypeFormatter | |
{ | |
public MyCustomMediaTypeFormatter() { | |
SupportedMediaTypes.Add(new MediaTypeHeaderValue("application/vnd.howard.fancyformat")); | |
} | |
protected override object OnReadFromStream(Type type, Stream stream, HttpContentHeaders contentHeaders) { | |
//stuff | |
} |
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 class OAuthFacebookOpHandler : HttpOperationHandler<HttpRequestMessage, HttpRequestMessage> { | |
readonly Uri _facebookBaseAuthUri = new Uri("https://www.facebook.com/dialog/oauth"); | |
readonly AuthorizeAttribute _authorizationAttribute; | |
readonly string _facebookAppId; | |
public OAuthFacebookOpHandler() : base("response") { } | |
public OAuthFacebookOpHandler(AuthorizeAttribute authorizeAttribute, string appId) : this() { | |
_authorizationAttribute = authorizeAttribute; | |
_facebookAppId = appId; |
OlderNewer