Skip to content

Instantly share code, notes, and snippets.

View AmirTugi's full-sized avatar

Amir Tugendhaft AmirTugi

View GitHub Profile
<mat-autocomplete #auto="matAutocomplete" [displayWith]="displayFn">
<mat-option *ngIf="isLoading" class="is-loading"><mat-spinner diameter="50"></mat-spinner></mat-option>
<ng-container *ngIf="!isLoading">
<mat-option *ngFor="let user of filteredUsers" [value]="user">
<span>{{ user.name }}</span>
<small> | ID: {{user.id}}</small>
</mat-option>
</ng-container>
</mat-autocomplete>
// Use !{var} to use unescaped conent
style(type="text/css") !{compiledStyle}
h1.title Invoice number ##{invoice.id}
p.created-at #{invoice.createdAt}
h3 For: #{invoice.customer.number}
table
body {
padding: 20px;
font-family: Halvetica, sans-serif;
.title {
margin-bottom: 4px;
}
.created-at {
font-size: 14px;
import TeaSchool from 'tea-school';
import * as pug from 'pug';
import * as path from 'path';
import {PDFOptions} from 'puppeteer';
import {Options as SassOptions} from 'node-sass';
(async () => {
/********************************
* STYLE OPTIONS *
********************************/
type MargheritaToppings = {
mushrooms?: boolean;
olives?: boolean;
onion?: boolean;
basil?: boolean;
};
type HawaiianToppings = {
pineapple?: boolean;
};
function purchasePizzaIngredients<P, T>() {
return {
purchaseToppings: (toppings: T) => {},
};
}
type ExtractToppings<P> = P extends Pizza<infer T> ? T : never;
type MargheritaToppings = {
mushrooms?: boolean;
olives?: boolean;
onion?: boolean;
basil?: boolean;
};
type MargheritaCheeses = {
mozzarella?: boolean;
parmesan?: boolean;
type ExtractToppings<P> = P extends Pizza<infer T, any> ? T : never;
function purchasePizzaIngredients<P>() {
return {
purchaseToppings: (toppings: ExtractToppings<P>) => {},
};
}