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
| const $ = selector => new Proxy( document.querySelector(selector)||Element, { get: (target, key) => Reflect.get(target, key) } ) ; | |
| Element.prototype.on = Element.prototype.addEventListener; |
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
| #!/bin/bash | |
| sudo mongod -f /etc/mongodb.conf --fork | |
| pm2 start ecosystem.config.js | |
| pm2 logs |
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
| div { | |
| overflow: hidden; | |
| text-overflow: ellipsis; | |
| white-space: nowrap; | |
| } |
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
| @mixin font-awesome-icon($unicode, $font-size: 1rem, $line-height: 1) { | |
| font-family: FontAwesome; | |
| font-size: $font-size; | |
| line-height: $line-height; | |
| content: unquote("\"\\#{$unicode}\""); | |
| display: inline-block; | |
| } |
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
| { | |
| "ordered-imports": [ | |
| true, | |
| { | |
| "grouped-imports": true, | |
| "import-sources-order": "any", | |
| "named-imports-order": "case-insensitive", | |
| "groups": [ | |
| { | |
| "name": "third-party", |
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 { ChangeDetectorRef, OnDestroy, Pipe, PipeTransform } from '@angular/core'; | |
| import { TranslateService } from '@ngx-translate/core'; | |
| import { get } from 'lodash'; | |
| import { Subscription } from 'rxjs'; | |
| import { ToursCatalog } from 'package-types'; | |
| @Pipe({ | |
| name: 'departureCityLabel', | |
| pure: false |
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
| type Constructor <T = {}> = new(...args: any[]) => T; | |
| function Timestamped <TBase extends Constructor> (Base: TBase) { | |
| return class extends Base { | |
| timestamp = Date.now(); | |
| }; | |
| } | |
| function Restorable <TBase extends Constructor> (Base: TBase) { | |
| return class extends Base { |
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 { merge, Observable } from 'rxjs'; | |
| import { distinctUntilChanged, map, tap } from 'rxjs/operators'; | |
| export function and(a: Observable<boolean>, b: Observable<boolean>): Observable<boolean> { | |
| let res1: boolean = false; | |
| let res2: boolean = false; | |
| return merge( | |
| a.pipe(tap((res: boolean) => res1 = res)), | |
| b.pipe(tap((res: boolean) => res2 = res)) |
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
| interface ValidationTest { | |
| arr: { haha: string } | { hoho: number }[]; | |
| obj: { oops: boolean }; | |
| str: string; | |
| } | |
| const schema: Validation<ValidationTest> = { | |
| arr: { type: 'array', items: { type: 'object', props: { haha: { type: 'string' } } } }, | |
| obj: { type: 'object', props: { oops: { type: 'boolean' } } }, | |
| str: { type: 'string' } |
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
| type OnlyPickedTypeFields<T extends object, P> = { [K in keyof T]: T[K] extends P ? K : never }[keyof T]; |
OlderNewer