Skip to content

Instantly share code, notes, and snippets.

View navix's full-sized avatar
❄️
Coding smart ;)

Oleksa Novyk navix

❄️
Coding smart ;)
View GitHub Profile
@navix
navix / .travis.yml
Created December 11, 2017 10:34 — forked from ronapelbaum/.travis.yml
How to run ESLint in you travis CI
language: node_js
node_js:
- "6"
script:
- npm run lint
- npm run build
- npm test
@navix
navix / simple_download
Last active October 22, 2017 16:35
Speedtest
wget -O /dev/null http://cachefly.cachefly.net/100mb.test
@navix
navix / spec.ts
Created October 10, 2017 05:25
Skip TestBed
describe('Quote Service', () => {
let mockApiService: ApiService;
let quoteService: QuoteService;
let mockResponse = [ ... ]; // mock todos response
beforeEach(() => {
mockApiService = { get: null } as ApiService;
spyOn(mockApiService, 'get').and.returnValue(Observable.of({
json: () => mockResponse
@navix
navix / async javascript.md
Created September 21, 2017 18:08 — forked from StevenACoffman/async javascript.md
Async Await in 7 seconds

Async / Await in 7 seconds

by Wassim Chegham (@manekinekko)

From this awesome animation, originally from this tweet

Callbacks (continuation passing style)

getData( a => {
	getMoreData(a, b => {
@navix
navix / readme.md
Last active July 21, 2025 17:12
TypeScript Deep Partial Interface

TypeScript Deep Partial Interface

export type DeepPartial<T> = T extends Function ? T : (T extends object ? { [P in keyof T]?: DeepPartial<T[P]>; } : T);

Before typescript@3.1

type DeepPartial = {
@navix
navix / component_takeUntil.ts
Created June 14, 2017 11:19 — forked from xtianjohns/component_takeUntil.ts
takeUntil for fun and for profit
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { MyService } from './MyService.ts';
import 'rxjs/add/operator/takeUntil';
@Component({
selector: 'my-rad-component',
@navix
navix / app.component.html
Created April 12, 2017 10:20
Angular: input/output decorators
<div *ngFor="let person of persons">
<app-person [data]="person" (upVote)="upVote(person, $event)"></app-person>
</div>
@navix
navix / component.html
Last active March 5, 2017 07:26
Angular: get i18n phrase in the code
<app-locale i18n-phrase-key phrase-key="Phrase One"
i18n-phrase-key-2 phrase-key-2="Phrase Two"
...
>
</app-locale>
@navix
navix / local_api_auth.md
Last active March 5, 2017 07:30
PE Local dev auth

Send requests with credentials

let requestOptions: RequestOptionsArgs = {
  ...
  withCredentials: true,

Send correct headers from server

@navix
navix / vc_component.ts
Last active January 25, 2017 16:17
Angular: get ElementRef by @ViewChild()
@ViewChild(ChildComponent, {read: ElementRef}) child: ElementRef;