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 { EMPTY, interval, Observable, of, throwError } from 'rxjs'; | |
import { catchError, finalize, map, switchMap, take as takeOperator, tap } from 'rxjs/operators'; | |
const noop = () => {}; | |
type WheneverEndCallback = (err?: any) => void; | |
interface WheneverEndParameters<T, O> { | |
callback?: WheneverEndCallback; | |
error?: (err: any, caught?: Observable<T>) => Observable<O> | void; |
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
// ==UserScript== | |
// @name Mark PR | |
// @namespace TFS | |
// @version 0.2 | |
// @description bookMark | |
// @author yannick | |
// @match https://*/* | |
// @grant none | |
// ==/UserScript== |
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
/** | |
* auto coerce data | |
* inspired by https://stackoverflow.com/a/49554548 | |
*/ | |
import { coerceArray, coerceBooleanProperty, coerceCssPixelValue, coerceNumberProperty } from '@angular/cdk/coercion'; | |
export type COERCE_TYPES = 'boolean' | 'number' | 'cssPixelValue' | 'array'; | |
function coerceFromType(value: any, type: COERCE_TYPES) { | |
switch (type) { |
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 { Replacement, RuleFailure, Rules, RuleWalker } from 'tslint'; | |
import { ImportDeclaration, SourceFile } from 'typescript'; | |
const disallowedImport = 'redux-observable'; | |
const disallowedClause = 'createEpicMiddleware'; | |
export class Rule extends Rules.AbstractRule { | |
public apply(sourceFile: SourceFile): RuleFailure[] { | |
return this.applyWithWalker(new Walker(sourceFile, this.getOptions())); | |
} |
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
/** | |
* auto unsubscribe annotation to unsubscribe subscription when component is detroyed | |
* how to use : | |
* | |
``` | |
export class DumbComponent implements OnDestroy { | |
@autoUnsubscribe() | |
subscription: Subscription; |
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
#!/bin/sh | |
######################### | |
# secure sails api by jwt | |
######################### | |
project_name='project' | |
# install sails | |
sudo npm -g install sails |
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
#!/bin/sh | |
################################### | |
# create deezer desktop app | |
# work on kubuntu 16.04 | |
################################### | |
application_dir=$HOME/.local/share/applications/ | |
icon_dir=$HOME/.local/share/icons/hicolor/256x256/app/ | |
icon_name=deezer.png |
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
#!/bin/sh | |
########################## | |
# Generate basic component | |
########################## | |
############# controls | |
if [ "$#" -ne 1 ]; then | |
echo "usage: ng2 <component_name>" | |
fi |