const groupBy = key => array =>
array.reduce((objectsByKeyValue, obj) => {
const value = obj[key];
objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
return objectsByKeyValue;
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
<div id="container" style="height:100%;"></div> |
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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using Xunit.Abstractions; | |
namespace MagicalUnicorns { | |
public class XunitConsoleForwarder : TextWriter { | |
private readonly ITestOutputHelper output; |
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
[assembly: ExportRenderer(typeof(ContentPage), typeof(ExtendedPageRenderer))] | |
public class ExtendedPageRenderer : PageRenderer | |
{ | |
public override void ViewWillAppear(bool animated) | |
{ | |
base.ViewWillAppear(animated); | |
var contentPage = this.Element as ContentPage; | |
if (contentPage == null || NavigationController == null) |
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 IDictionary<string, object> ToDictionary(this object values) | |
{ | |
var dict = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase); | |
if (values != null) | |
{ | |
foreach (PropertyDescriptor propertyDescriptor in TypeDescriptor.GetProperties(values)) | |
{ | |
object obj = propertyDescriptor.GetValue(values); | |
dict.Add(propertyDescriptor.Name, obj); |