Skip to content

Instantly share code, notes, and snippets.

View duxor's full-sized avatar

Dušan Perišić duxor

View GitHub Profile
@duxor
duxor / .gitlab-ci.yml
Created January 20, 2020 18:25
Basic Angular continuous deployment config (GitlabCI)
# startupkin.com basic test config
image: trion/ng-cli-e2e:latest
stages:
- build
- deploy
build_stage:
stage: build
script:
@duxor
duxor / mobile.hosts.example
Last active January 13, 2020 18:10
How to make custom domain from docker available on mobile device in the same network
# /etc/hosts
127.0.0.1 startupkin.test
# /etc/nginx/sites-available/startupkin.test.conf
server {
listen 80;
listen [::]:80;
server_name startupkin.test;
root /var/www/startupkin/public;
@duxor
duxor / api.interceptor.ts
Last active January 6, 2020 18:56
Angular API interceptor with request/response time duration and ngrx selector.
import {HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';
import {Injectable} from '@angular/core';
import {Router} from '@angular/router';
import {environment} from '@env/environment';
import {Store} from '@ngrx/store';
import {Observable, throwError} from 'rxjs';
import {catchError, finalize, first, flatMap} from 'rxjs/operators';
import {AppState} from '@store/app.states';
import {TokenStorageService} from '@coreServices/user/token-storage.service';
import {getTokensState} from '@store/selectors/auth.selector';