Skip to content

Instantly share code, notes, and snippets.

@bennett000
bennett000 / index.html
Created September 16, 2018 02:58
Angular 6, Pure JavaScript
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Hello Angular</title>
<meta name="description" content="Hello Angular">
<meta name="author" content="Michael J. Bennett">
@bennett000
bennett000 / the-case-for-shipping-ts-as-ts.md
Last active September 3, 2018 18:43
The Case For Shipping TypeScript as TypeScript

Current JS Module Packaging

It's 2018 and the JS community is still in the midst of unifying a module standard. There currently exist three major ways for packaging/shipping JS modules:

  • Browser bundles (IIFEs, UMD, Whatever)
  • CommonJS modules
  • ES2015 modules

Generally ES2015 modules are the "best" way to ship JS in 2018. The reasons for this come down to tree shaking and future proofing and are well discussed by others elsewhere on the internet.

npm install @angular/common @angular/compiler @angular/core @angular/http @angular/platform-browser @angular/platform-browser-dynamic @angular/router @angular/router-deprecated rxjs zone.js reflect-metadata
'use strict';
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const proxy = require('./server/webpack-dev-proxy');
const StyleLintPlugin = require('stylelint-webpack-plugin');
const loaders = require('./webpack/loaders');
// Karma configuration
// Generated on Tue Feb 04 2014 21:57:25 GMT-0500 (EST)
/*global module, require */
const path = require('path');
module.exports = function(config) {
'use strict';
config.set(
{
// enable / disable watching file and executing tests whenever any
/**
* This gist is not recommended to be used for anything, other than
* an example for a story about old school hit counters, and the
* complexity of "dynamic" web pages vs static web pages.
*/
var http = require('http'),
fs = require('fs');
http.createServer(onHTTPReq).listen(8000);
@bennett000
bennett000 / ejs-filter-hack-node-email-templates.js
Created December 22, 2013 16:19
EJS Filter Hack on node-email-templates
// from main.js
// this is just a hack :)
// # Email Template
var EmailTemplate = function(templateDirectory, defaults, filters, done) {
if (typeof defaults === 'function') done = defaults;
// move the done function "over" if the filters arent' being used
if (typeof filters === 'function') done = filters;