Skip to content

Instantly share code, notes, and snippets.

import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'initials' })
export class InitialsPipe implements PipeTransform {
transform(user: any, type?: string): string {
if (user &&
type === 'post' &&
user.action_by_first_name &&
user.action_by_last_name) {
return user.action_by_first_name.slice(0, 1) + user.action_by_last_name.slice(0, 1);
@mudroljub
mudroljub / combinators.js
Last active May 10, 2019 14:52 — forked from lupuszr/combinators.js
Common combinators in JavaScript
// list of combinators http://www.angelfire.com/tx4/cus/combinator/birds.html
const I = x => x;
const K = x => y => x; // T
const A = f => x => f(x);
const T = x => f => f(x);
const W = f => x => f(x)(x);
const C = f => y => x => f(x)(y);
const B = f => g => x => f(g(x));
const S = f => g => x => f(x)(g(x));
const P = f => g => x => y => f(g(x))(g(y));
/* Wooden Wall [CSS] */
/* Made with ♥ by Louis Bullock */
html,body {
height: 100%;
overflow: hidden;
}
html {
display:block;