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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics.Contracts; | |
using System.Linq.Expressions; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using SQLite; | |
namespace MobCat.Data.Repositories | |
{ |
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 interface IDataRepository<TEntity> : IDisposable where TEntity : class | |
{ | |
ICollection<TEntity> Find( | |
Expression<Func<TEntity, bool>> criteria, | |
Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>> orderBy = null, | |
string includeProperties = ""); | |
Task<ICollection<TEntity>> FindAsync( | |
Expression<Func<TEntity, bool>> criteria, | |
Func<IQueryable<TEntity>, IOrderedQueryable<TEntity>> orderBy = null, | |
string includeProperties = ""); |
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 { AsyncObserver, AsyncObserverX } from './asyncobserver'; | |
import { AsyncObservable, AsyncObservableX } from './asyncobservable'; | |
import { AsyncSubscription } from './asyncsubscription'; | |
import { AsyncSubscriptionX } from './subscriptions/asyncsubscriptionx'; | |
import { CompositeAsyncSubscription } from './subscriptions/compositeasyncsubscription'; | |
import { BinarySubscription } from './subscriptions/stablecompositeasyncsubscription'; | |
import { SingleAssignmentAsyncSubscription } from './subscriptions/singleassignmentasyncsubscription'; | |
import { bindCallback } from '../internal/bindcallback'; | |
class InnerObserver<T, R> extends AsyncObserverX<R> { |
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
#!/usr/bin/env bash | |
(set -x; brew update;) | |
(set -x; brew upgrade;) | |
(set -x; brew cleanup;) | |
(set -x; brew cask cleanup;) | |
red=`tput setaf 1` | |
green=`tput setaf 2` | |
reset=`tput sgr0` |
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 { identity, identityAsync } from '../internal/identity'; | |
// tslint:disable-next-line:no-empty | |
const NEVER_PROMISE = new Promise(() => {}); | |
type MergeResult<T> = { value: T; index: number }; | |
function wrapPromiseWithIndex<T>(promise: Promise<T>, index: number) { | |
return promise.then(value => ({ value, index })) as Promise<MergeResult<T>>; | |
} |
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 { identity } from '../internal/identity'; | |
// tslint:disable-next-line:no-empty | |
const NEVER_PROMISE = new Promise(() => {}); | |
type MergeResult<T> = { value: T; index: number }; | |
function wrapPromiseWithIndex<T>(promise: Promise<T>, index: number) { | |
return promise.then(value => ({ value, index })) as Promise<MergeResult<T>>; | |
} |
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 { AsyncIterableX } from './asynciterablex'; | |
import { identity } from '../internal/identity'; | |
// tslint:disable-next-line:no-empty | |
const NEVER_PROMISE = new Promise(() => {}); | |
type MergeResult<T> = { value: T; index: number }; | |
function wrapPromiseWithIndex<T>(promise: Promise<T>, index: number) { | |
return promise.then(value => ({ value, index })) as Promise<MergeResult<T>>; |
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 { Readable } from 'stream'; | |
import { AsyncIterableX } from './asynciterablex'; | |
enum StreamState { | |
NonFlowing, | |
Readable, | |
Ended, | |
Errored | |
} |
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
'use strict'; | |
export abstract class AceOfBase { | |
private _eyesOpen: boolean = false; | |
openEyes(): void { | |
this._eyesOpen = true; | |
} | |
sawSign(): boolean { |
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 { AsyncIterableX } from '../asynciterable'; | |
import { AsyncSink } from '../asyncsink'; | |
import { memoize } from './memoize'; | |
export function asyncify<TSource>( | |
func: Function | |
): (...args: any[]) => AsyncIterableX<TSource> { | |
return function(...args: any[]) { | |
const sink = new AsyncSink<TSource>(); |