Skip to content

Instantly share code, notes, and snippets.

View SerhiiSerdiuk's full-sized avatar

Serhii Serdiuk SerhiiSerdiuk

View GitHub Profile
@SerhiiSerdiuk
SerhiiSerdiuk / map.pipe.ts
Created May 18, 2021 09:07 — forked from yannickglt/map.pipe.ts
Generic pure Angular pipe
// A safe way to call methods in templates
// Live demo @ https://stackblitz.com/edit/angular-generic-map-pipe
import { Pipe, PipeTransform } from "@angular/core";
// Methods passed to the map pipe cannot (and should not) use the `this` keyword from components. Otherwise, it would not be a pure pipe.
@Pipe({ name: "map" })
export class MapPipe implements PipeTransform {
public transform<T, R>(
thisArg: T,
project: (t: T, ...others: any[]) => R,
@SerhiiSerdiuk
SerhiiSerdiuk / 0_reuse_code.js
Created November 5, 2016 17:04
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);