Skip to content

Instantly share code, notes, and snippets.

Stephen Fluin StephenFluin

Block or report user

Report or block StephenFluin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View lazy-images.directive.ts
import { Directive, ElementRef } from '@angular/core';
selector: 'img'
export class LazyImagesDirective {
constructor(ref: ElementRef) {
ref.nativeElement.loading = 'lazy';
StephenFluin /
Last active May 28, 2019
8.0.0 Contributors


Adam Bradley, Adam Plumer, Adam Yi, Ahsan Ayaz, Alan, Alan Agius, Alberto Garza, Alex Eagle, Alexey Zuev,

View emits.ts
import { Component, Output } from '@angular/core';
import { Subject } from 'rxjs';
template: '<child-component (myCustomEvent)="$event)"></child-component>',
export class EmitComponent {
@Output() myOtherEvent = new Subject<any>();
StephenFluin /
Created Jul 11, 2018
Install Angular on a *nix system
curl -o- | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/" ] && \. "$NVM_DIR/" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install 10
# Yarn
curl -o- -L | bash
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
View test.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const ts = require("typescript");
const plugin_1 = require("./plugin");
const refactor_1 = require("./refactor");
const loaderUtils = require('loader-utils');
const NormalModule = require('webpack/lib/NormalModule');
// This is a map of changes which need to be made
const changeMap = {
View md-select
From: {{from}}
<md-select [(ngModel)]="from">
<md-option value="200">2.0</md-option>
<md-option value="201">2.1</md-option>
<md-option value="202">2.2</md-option>
<md-option value="203">2.3</md-option>
<md-option value="204">2.4</md-option>
<md-option value="400">4.0</md-option>
<md-option value="500">5.0</md-option>
StephenFluin / generate-http2-push-headers.js
Created Mar 20, 2017
NodeJS Command to generate firebase compatible headers for your Angular app
View generate-http2-push-headers.js
fs = require('fs');
fs.readdir('dist/', (err, files) => {
files = files.filter(file => {
if(file.indexOf('.gz') != -1) {
return false;
if(file.indexOf('favicon') != -1) {
return false
StephenFluin /
Created Mar 10, 2017
Give the 2.4.x to 4.0.0-rc upgrade a try!
ng new my-project
cd my-project
# We have a working v2.4.x project now!
ng build -prod
# Let's save a working copy of the 2.4.x project
mv dist dist-2.4.x
# Now let's update to the latest version of Angular
StephenFluin /
Last active Mar 7, 2017
Angular package switching
StephenFluin / md-input-fix.html
Last active Feb 22, 2017
Regex to update your md-input tags
View md-input-fix.html
<!-- regex this with that -->
<md-input (.*)></md-input>
<md-input-container><input mdInput $1></md-input-container>
You can’t perform that action at this time.