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 rec (state, key) { | |
return state.update(function (current) { | |
return current.delete(key).map(function (item) { | |
return Iterable.isIterable(item) ? rec(item, key) : item | |
}); | |
}); | |
} | |
function recursiveDelete (state, key) { | |
return state.update(function (current) { |
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
internal class PropertyInjectionDisabler : IPropertyDependencySelector | |
{ | |
public IEnumerable<PropertyDependency> Execute(Type type) | |
{ | |
return new PropertyDependency[0]; | |
} | |
} |
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
internal static class MigrationExtensions | |
{ | |
internal const string IdColumnName = "Id"; | |
public static ICreateTableColumnOptionOrWithColumnSyntax WithIdColumn(this ICreateTableWithColumnSyntax syntax) => syntax | |
.WithColumn(IdColumnName) | |
.AsInt32() | |
.NotNullable() | |
.PrimaryKey() | |
.Identity(); |
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 TransactionFactory : ITransactionFactory | |
{ | |
public ITransaction BeginTransaction(TransactionScopeOption option = TransactionScopeOption.Required, IsolationLevel isolationLevel = IsolationLevel.Unspecified) | |
{ | |
var currentTransaction = System.Transactions.Transaction.Current; | |
if (currentTransaction != null && option == TransactionScopeOption.Required) | |
{ | |
if (isolationLevel == IsolationLevel.Unspecified || currentTransaction.IsolationLevel == isolationLevel) | |
isolationLevel = currentTransaction.IsolationLevel; | |
else |
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 MockObjectSet<T> : IObjectSet<T> where T : class | |
{ | |
private readonly ICollection<T> _collection = new List<T>(); | |
public MockObjectSet() | |
{ | |
} | |
public MockObjectSet(ICollection<T> collection) | |
{ |
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
// Somewhere in assembly | |
[assembly: AspMvcViewLocationFormat(@"~\Features\{1}\{0}.cshtml")] | |
[assembly: AspMvcViewLocationFormat(@"~\Features\Shared\{0}.cshtml")] | |
public class Startup | |
{ | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddMvc(o => { | |
o.Conventions.Add(new FeatureConvention()); |
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 static class HostingEnvironmentExtensions | |
{ | |
public static void UseRootNodeModules(this IHostingEnvironment hostingEnvironment) | |
{ | |
var nodeDir = Path.Combine(hostingEnvironment.ContentRootPath, "../node_modules"); | |
Environment.SetEnvironmentVariable("NODE_PATH", nodeDir); | |
} | |
} |
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 React from 'react' | |
class Container extends React.Component { | |
render () { | |
return ( | |
<div style={{ display: 'flex', flexDirection: 'column' }}> | |
<h1>Submission</h1> | |
<input type="text" placeholder="First name" /> | |
<input type="text" placeholder="Last name" /> | |
<input type="text" placeholder="Title" /> |
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
{ | |
"version": 8, | |
"name": "Positron", | |
"metadata": { | |
"mapbox:autocomposite": false, | |
"mapbox:type": "template", | |
"mapbox:groups": { | |
"b6371a3f2f5a9932464fa3867530a2e5": { | |
"name": "Transportation", | |
"collapsed": false |
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
app.Use(async (context, next) => | |
{ | |
try | |
{ | |
await next(); | |
} | |
catch (Exception ex) | |
{ | |
context.Response.Clear(); | |
context.Response.StatusCode = 500; |