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 interface IRepository<TAggregateRoot> where TAggregateRoot : IAggregateRoot | |
{ | |
public void Add(params TAggregateRoot[] entities); | |
public void Remove(params TAggregateRoot[] entities); | |
public Task<TAggregateRoot?> SingleOrDefaultAsync( | |
ISpecification<TAggregateRoot> specification, | |
CancellationToken cancellationToken = default); |
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 sealed class AddTemporaryFileInputValidator : AbstractValidator<AddTemporaryFileInput> | |
{ | |
public AddTemporaryFileInputValidator() | |
{ | |
this.RuleFor(f => f.TemporaryFileName) | |
.NotEmptyWithLength(FileName.MinimumLength, FileName.MaximumLength) // using VO metadata | |
.Must(FileName.ValidateCharacters) // using VO validation logic | |
.WithErrorCode(nameof(FileName.Errors.FileNameDisallowedCharacters)); // using VO validation message/code | |
} | |
} |
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 EntityIdOperationFilterInputType : FilterInputType | |
{ | |
protected override void Configure(IFilterInputTypeDescriptor descriptor) | |
{ | |
descriptor | |
.Operation(DefaultFilterOperations.Equals) | |
.Type<LongType>(); | |
} | |
} |
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
import axios from "axios"; | |
import type {IncomingMessage} from "node:http"; | |
import type {Middleware} from "koa"; | |
/** | |
* A default set of user agent patterns for bots/crawlers that do not perform | |
* well with pages that require JavaScript. | |
*/ | |
export const botUserAgents = [ | |
// spell-checker:disable |
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
import {autoinject, bindingMode, customAttribute} from "aurelia-framework"; | |
/** | |
* Ensures that array elements are numbers. | |
* | |
* TODO: Using this custom attribute because value converters and binding behaviors are not working well with | |
* multi-select elements. See https://github.com/aurelia/binding/issues/611. | |
*/ | |
@autoinject | |
@customAttribute("gg-number-array", bindingMode.twoWay) |
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
<template> | |
<h1>Instructions</h1> | |
<ol> | |
<li>Click the "Set value" button (selected option changes correctly)</li> | |
<li>Increment number to 3</li> | |
<li>Click the "Set options and value" button (selected option is not set correctly)</li> | |
</ol> | |
<select value.bind="matchGame.winner.id"> |
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
<template> | |
<h1>Dialog Repro</h1> | |
<button click.delegate="submit()">Open Dialog</button> | |
</template> |
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
<template> | |
<require from="./select2-custom-attribute"></require> | |
<require from="./debug"></require> | |
<h1>Standard Select</h1> | |
<select value.bind="selectedThings" style="width: 100%"> | |
<option repeat.for="thing of things" model.bind="thing">${thing.name}</option> | |
</select> | |
<h1>Select2</h1> |
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
Hi, | |
I'm noticing that a disturbing number of package managers[1] and other software projects[2] are making use of JSON as a | |
configuration format, which is starting to bother me (probably more than it should), since JSON is a data serialization | |
format, and was not intended for this purpose (as I understand it). | |
Have you considered writing a new specification for a format that is more suited to such uses? Something similar to | |
JSON5 or YAML. YAML is pretty cool, but people don't like/use it because (I assume): | |
1. It has a stupid name. |
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
// Note: The definitions below are incomplete, they are just used to satisfy the TypeScript compiler for now. | |
declare module "glob2base" { | |
var glob2base: any; | |
export = glob2base; | |
} | |
declare module "gulp" { | |
var gulp: any; | |
export = gulp; |
NewerOlder