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 IQueryable<T> FindBy(Expression<Func<T, bool>> predicate, params Expression<Func<T, object>>[] includes) | |
{ | |
var query = GetAll().Where(predicate); | |
return includes.Aggregate(query, (current, includeProperty) => current.Include(includeProperty)); | |
} | |
// Sample usage | |
userRepository.FindBy(x => x.Username == username, x.Roles) |
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
(dir -include *.cs,*.xaml -recurse | select-string .).Count |
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
module Functional_Kats_Kata = | |
type PatternType = | |
| Asterisk | |
| Question | |
| None | |
let findPattern (input:string) (pattern:string) patternType = | |
match patternType with | |
| Asterisk -> |
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
<template> | |
<require from='./grid-view'></require> | |
Aurelia app ${message} | |
<!--<click-to-edit display-value="some display value"> | |
<template replace-part='content-template'> | |
<input type='text' value='yoyo' /> | |
</template> | |
</click-to-edit>--> |
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
<template> | |
<require from="./click-to-edit"></require> | |
<click-to-edit> | |
<template replace-part='item-template'> | |
This text node is in DOM only after click | |
</template> | |
</click-to-edit> | |
</template> |
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
<template> | |
<h1>${message}</h1> | |
</template> |
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
const curry = (fun, arg) => (...args) => fun(...[arg, ...args]); |
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 {inject, customAttribute, bindable} from 'aurelia-framework'; | |
import 'jquery'; | |
import 'npm:[email protected]/dist/bootstrap-treeview.min.js'; | |
import {Test} from './treenode'; | |
@customAttribute('treeview') | |
@inject(Element) | |
export class TreeViewCustomAttribute { | |
element: Element; |
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
type Shape = | |
{ kind: "circle", radius: number} | | |
{ kind: "rectangle", w: number, h: number} | | |
{ kind: "square", size: number} | |
function assertNever(obj: never) { | |
throw new Error("unexpected object"); | |
} | |
function getArea(shape: Shape) { |
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
Get-ChildItem -Recurse -Include *.* | Select-String "column-flex-container" | |
// Get could of lines in files of type | |
(dir -include *.scss -recurse | select-string .).Count | |
or | |
Get-ChildItem -Filter "*.cs" -Recurse | Get-Content | Measure-Object -line | |
// Get count of files of type | |
(dir -include *.ts -recurse).Count | |
or |
OlderNewer