Skip to content

Instantly share code, notes, and snippets.

View StephenFluin's full-sized avatar

Stephen Fluin StephenFluin

View GitHub Profile
"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 = {
<div>
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
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 / 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 / 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 / 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//'