Skip to content

Instantly share code, notes, and snippets.

View sangress's full-sized avatar
💾
coding

Shai Angress sangress

💾
coding
View GitHub Profile
@Injectable()
export class AuthInterceptor implements HttpInterceptor {
constructor(private authService: AuthService, private localStorageService: LocalStorageService ) {}
intercept(req: HttpRequest<any>, next: HttpHandler) {
const authRequest = req.clone({});
return next.handle(authRequest);
return next.handle(authRequest).pipe(
filter(event => event instanceof HttpResponse),
tap((event: HttpResponse<any>) => {
Shader "Unlit/WorldMapHighlight"
{
Properties{
_Color ("Tint", Color) = (0, 0, 0, 1)
_FullColor ("Full Color", Color) = (0, 0, 0, 1)
_MainTex ("Texture", 2D) = "white" {}
// _HighlightUV ("highlightUV", Vector) = (0, 0, 0, 1)
_HighlightUV ("Highlight", Color) = (0, 0, 0, 1)
}
@sangress
sangress / CameraShake.cs
Created November 8, 2017 19:47 — forked from ftvs/CameraShake.cs
Simple camera shake effect for Unity3d, written in C#. Attach to your camera GameObject. To shake the camera, set shakeDuration to the number of seconds it should shake for. It will start shaking if it is enabled.
using UnityEngine;
using System.Collections;
public class CameraShake : MonoBehaviour
{
// Transform of the camera to shake. Grabs the gameObject's transform
// if null.
public Transform camTransform;
// How long the object should shake for.
@sangress
sangress / get-args.js
Created January 29, 2017 09:23
get arguments for node.js (requires lodash), supports arguments that passed with `--arg=value`
module.exports = (args) => {
return _.chain(args).map(arg => {
let argProps = arg.replace('--', '').split('=');
return argProps;
}).fromPairs().value();
};
@sangress
sangress / replace.pipe.ts
Created December 27, 2016 16:22
Angular2 replace pipe
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'replace'
})
export class ReplacePipe implements PipeTransform {
transform(value: string, expr: any, arg2: string): any {
if (!value)
return value;
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
/*.menu {
display: flex;
flex-direction: row;
width: 100%;
height: 40px;
background-color: #000;
let pollDelay = 750;
function () {
this.m = _.memoize(function (time) {
return time + pollDelay;
});
this.t = 0;
this.rm = _.noop;
this.getEvents = function () {
@sangress
sangress / media_queries.css
Created May 30, 2016 20:21
media_queries_ex
body {
display: flex;
justify-content: center;
align-items: center;
}
div {
width: 400px;
height: 400px;
border: 1px dashed green;
@sangress
sangress / index.html
Last active May 30, 2016 19:46
flexbox_ex_template
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
@sangress
sangress / index.html
Created May 30, 2016 19:28
text-effects
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<p class="whiteonblack">Lorem ipsum <span>dolor</span> sit amet, consectetur adipisicing elit. Blanditiis voluptate modi magni, quas pariatur iste possimus illo officia doloribus earum delectus necessitatibus voluptas consequatur accusantium obcaecati, accusamus labore tempore atque.</p>