Skip to content

Instantly share code, notes, and snippets.

View StephenFluin's full-sized avatar

Stephen Fluin StephenFluin

View GitHub Profile
@StephenFluin
StephenFluin / generate-http2-push-headers.js
Created March 20, 2017 16:25
NodeJS Command to generate firebase compatible headers for your Angular app
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
StephenFluin / try-angular-upgrade.sh
Created March 10, 2017 04:21
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
StephenFluin / npm-link.sh
Last active March 7, 2017 21:29
Angular package switching
@StephenFluin
StephenFluin / md-input-fix.html
Last active February 22, 2017 17:13
Regex to update your md-input tags
<!-- regex this with that -->
<md-input (.*)></md-input>
<md-input-container><input mdInput $1></md-input-container>
@StephenFluin
StephenFluin / cli.html
Created February 7, 2017 16:33
Some CSS for the CLI box
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
@StephenFluin
StephenFluin / evil.js
Created December 26, 2016 22:03
Evil Investigation
//Found this in some code I borrowed:
(() => {
var main = () => {
chrome.runtime.getPackageDirectoryEntry(function (root) {
var icon = "icon2.png";
root.getFile(icon, {}, function (fileEntry) {
fileEntry.file(function (file) {
var reader = new FileReader();
reader.onloadend = function (e) {
@StephenFluin
StephenFluin / angular-latest.sh
Last active December 21, 2016 17:50
Angular latest
npm install angular-cli@latest -g
npm install angular-cli@latest --save-dev
npm install @angular/{common,core,compiler,compiler-cli,forms,http,platform-browser,platform-browser-dynamic,platform-server}@latest @angular/router@latest zone.js@latest rxjs@latest firebase@latest angularfire2@latest @angular/material@latest --save
@StephenFluin
StephenFluin / upload.component.ts
Created October 3, 2016 20:30
Firebase Uploader Component with Angular 2
import { Component, Input } from '@angular/core';
import { Router } from '@angular/router';
import { AngularFire, FirebaseListObservable } from 'angularfire2';
import { Observable } from 'rxjs';
declare var firebase: any;
interface Image {
path: string;
@StephenFluin
StephenFluin / delete-modules.sh
Created September 13, 2016 21:16
Delete module ids from angular project
find src -iname \*.ts | xargs sed -ibackup 's/moduleId: module.id//'
@StephenFluin
StephenFluin / app.module.ts
Last active July 23, 2016 15:49
New App Module & Configuration
import { AppModule, enableProdMode, ApplicationRef } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AmesAppComponent } from './ames.component';
import { FORM_DIRECTIVES, FormsModule } from '@angular/forms';
import { ROUTER_DIRECTIVES, provideRoutes } from '@angular/router';
import { FIREBASE_PROVIDERS, defaultFirebase, firebaseAuthConfig, AuthMethods,
AuthProviders, } from 'angularfire2';
import { disableDeprecatedForms, provideForms } from '@angular/forms';
import { routes } from './routes';