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
/* Initialize bus. In this case via Autofac */ | |
builder.RegisterModule(new RabbitModule | |
{ | |
HostName = "localhost", | |
UserName = "user", | |
Password = string.Empty, | |
Exchanges = { | |
new Exchange("exchange1"){Durable=true;}, | |
new Exchange("exchange2"){Durable=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
static class ObjectDiff | |
{ | |
static IEnumerable<Member> GetMembers(object obj) | |
{ | |
foreach(var propertyInfo in obj.GetType().GetProperties().Where(p => p.CanRead)) | |
{ | |
var info = propertyInfo; | |
yield return new Member | |
{ | |
Name = info.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
public class JsonWithHtmlMediaTypeFormatter : JsonMediaTypeFormatter | |
{ | |
public JsonWithHtmlMediaTypeFormatter() | |
{ | |
SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/html")); | |
} | |
public override void SetDefaultContentHeaders(Type type, HttpContentHeaders headers, string mediaType) | |
{ | |
base.SetDefaultContentHeaders(type, headers, mediaType); |
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
Kudu.SiteManagement/SiteManager.cs | 31 ++++++++++++++++++------------- | |
1 file changed, 18 insertions(+), 13 deletions(-) | |
diff --git a/Kudu.SiteManagement/SiteManager.cs b/Kudu.SiteManagement/SiteManager.cs | |
index 43a6012..87b466d 100644 | |
--- a/Kudu.SiteManagement/SiteManager.cs | |
+++ b/Kudu.SiteManagement/SiteManager.cs | |
@@ -6,12 +6,15 @@ | |
using System.Net.NetworkInformation; | |
using System.Threading; |
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 OutOfMemoryTest | |
{ | |
public void Run() | |
{ | |
// client version 1.2.2127 | |
using(var store = new DocumentStore | |
{ | |
Url = "http://TestRaven:8080", | |
DefaultDatabase = "Test", | |
}) |
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() { | |
"use strict"; | |
// constructor function - but R# Name dose not match rule 'Local Variable'. Suggested name is app. | |
var App = function() { | |
// ... | |
}; | |
ko.applyBindings(new App()); | |
})(); |
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 Mutable { | |
} | |
[Immutable] | |
public class ImmutableB | |
{ | |
public readonly A = new ImmutableA(); | |
} |
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 data = []; | |
exampleFeeds.forEach(function(feedFile) { | |
fs.createReadStream(feedFile) | |
.pipe(new FeedParser()) | |
.on('meta', function(meta) { | |
data.push(meta); | |
if(data.length===exampleFeeds.length){ | |
console.log('done '+data.length); | |
// do something | |
} |
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
As lisp programmers have know for a long time it is better to have a smallish number of ubiquitous data types and a large number of small functions that work on them, than to have a large number of data types and a small number of functions that work on them. |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<script src="/node_modules/redux/dist/redux.js" type="text/javascript"></script> | |
<script src="/node_modules/mori/mori.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
"use strict"; | |
function reducer(){ | |
return mori.hashMap('key','value'); |