Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-config-airbnb-base eslint-plugin-node eslint-config-node
| /** | |
| * If argument is a string, try to parse as JSON. | |
| * Otherwise return null. | |
| */ | |
| export function parseOrNull(raw: unknown) { | |
| if (!raw) return null | |
| if (typeof raw === 'string') { | |
| try { | |
| return JSON.parse(raw) |
| <link rel="shortcut icon" width=32px> | |
| <canvas style="display: none" id="loader" width="16" height="16"></canvas> | |
| <script> | |
| class Loader { | |
| constructor(link, canvas) { | |
| this.link = link; | |
| this.canvas = canvas; | |
| this.context = canvas.getContext('2d'); | |
| this.context.lineWidth = 2; |
| <body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c> |
| ffmpeg -i "c:/videos/sample.mp4 | |
| -map 0:v:0 -map 0:a:0 -map 0:v:0 -map 0:a:0 -map 0:v:0 -map 0:a:0 | |
| -c:v libx264 -crf 22 -c:a aac -ar 48000 | |
| -filter:v:0 scale=w=480:h=360 -maxrate:v:0 600k -b:a:0 64k | |
| -filter:v:1 scale=w=640:h=480 -maxrate:v:1 900k -b:a:1 128k | |
| -filter:v:2 scale=w=1280:h=720 -maxrate:v:2 900k -b:a:2 128k | |
| -var_stream_map "v:0,a:0,name:360p v:1,a:1,name:480p v:2,a:2,name:720p" | |
| -preset slow -hls_list_size 0 -threads 0 -f hls -hls_playlist_type event -hls_time 3 | |
| -hls_flags independent_segments -master_pl_name "name-pl.m3u8" | |
| "c:/videos/encoded/name-%v.m3u8" |
Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-config-airbnb-base eslint-plugin-node eslint-config-node
| version: '3' | |
| services: | |
| traefik: | |
| restart: unless-stopped | |
| image: traefik:v2.0.2 | |
| ports: | |
| - "80:80" | |
| - "443:443" | |
| labels: | |
| - "traefik.http.services.traefik.loadbalancer.server.port=8080" |
| import { NgModule } from '@angular/core'; | |
| import { CommonModule } from '@angular/common'; | |
| import {MatCheckboxModule} from '@angular/material'; | |
| import {MatButtonModule} from '@angular/material'; | |
| import {MatInputModule} from '@angular/material/input'; | |
| import {MatAutocompleteModule} from '@angular/material/autocomplete'; | |
| import {MatDatepickerModule} from '@angular/material/datepicker'; | |
| import {MatNativeDateModule} from '@angular/material'; | |
| import {MatFormFieldModule} from '@angular/material/form-field'; | |
| import {MatRadioModule} from '@angular/material/radio'; |
| /* Basic example of saving cookie using axios in node.js and session's recreation after expiration. | |
| * We have to getting/saving cookie manually because WithCredential axios param use XHR and doesn't work in node.js | |
| * Also, this example supports parallel request and send only one create session request. | |
| * */ | |
| const BASE_URL = "https://google.com"; | |
| // Init instance of axios which works with BASE_URL | |
| const axiosInstance = axios.create({ baseURL: BASE_URL }); |
| export class ChunkingService { | |
| public chunkSize = 1024 * 1024; | |
| private _chunkQueue$ = new Subject(); | |
| private _maxConnections = 3; | |
| constructor( | |
| private _apiService: apiService, | |
| private _store: Store<any>) { | |
| Guard.notNothing(_apiService, '_apiService'); | |
| Guard.notNothing(_store, '_store'); |
| import { | |
| Directive, | |
| EventEmitter, | |
| InjectFlags, | |
| Injector, | |
| OnDestroy, | |
| OnInit, | |
| Type | |
| } from '@angular/core'; | |
| import { AbstractControl, FormControlDirective, FormControlName } from '@angular/forms'; |