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 / angular-in-view-directives.html
Created February 11, 2019 11:24 — forked from th0r/angular-in-view-directives.html
Angular `InView` directives
<!-- wInViewRoot directive is needed to specify the `root` for `IntersectionObserver` and some other it's options e.g. `margin` -->
<div class="container" wInViewRoot="viewport">
Any content can be here
<w-in-view-item>
<!-- Content will be replaced by a placeholder <div> with the same height as original content.
Also `InViewItemComponent`s change detector will be detached when it become invisible which means
all the content's change detectors won't be reachable and will be inactive as well. -->
</w-in-view-item>
...or any other content can be here
<w-in-view-item>

Gradient shadow in pure CSS

alt text

HTML
<button>Let's Go !</button>
@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 / 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 / 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 / color_luminance.php
Created February 2, 2016 13:22 — forked from stephenharris/color_luminance.php
Lighten or darken a given colour
<?php
/**
* Lightens/darkens a given colour (hex format), returning the altered colour in hex format.7
* @param str $hex Colour as hexadecimal (with or without hash);
* @percent float $percent Decimal ( 0.2 = lighten by 20%(), -0.4 = darken by 40%() )
* @return str Lightened/Darkend colour as hexadecimal (with hash);
*/
function color_luminance( $hex, $percent ) {
// validate hex string
@navix
navix / auto_restart_webserver.sh
Last active September 10, 2015 05:03 — forked from xi4oh4o/auto_restart_webserver.sh
Auto restart phpfpm on 502 & 504 Error also save logs
#!/bin/bash
MY_URL="http://moefou.org" #change you website
RESULT_502=`curl -I $MY_URL|grep "HTTP/1.1 502"`
RESULT_504=`curl -I $MY_URL|grep "HTTP/1.1 504"`
if [ -n "$RESULT_502" ]; then
killall php-fpm;php-fpm
date>>/data/logs/web_error.log;echo "502 Bad Gateway">>/data/logs/web_error.log
elif [ -n "$RESULT_504" ]; then
killall php-fpm;php-fpm
date>>/data/logs/web_error.log;echo "504 Gateway Time-out">>/data/logs/web_error.log