This file contains hidden or 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
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<polymer-element name="my-element"> |
This file contains hidden or 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 FunctionalBindingExtensions | |
{ | |
public static Action<T2> Bind<T1, T2>(this Action<T1, T2> action, Func<T1> getValueFunc) | |
{ | |
return action.Bind(getValueFunc()); | |
} | |
public static Action<T1> Bind<T1, T2>(this Action<T1, T2> action, Func<T2> getValueFunc) | |
{ |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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, |