- AWS Lambda@Edge (enabled Preview)
- One Amazon CloudFront Distribution (origin doesn't matter)
- IAM role (basic execution is enough)
- npm to install Node.js dependencies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ScriptAsyncAttrSupportPlugin() {} | |
module.exports = ScriptAsyncAttrSupportPlugin; | |
ScriptAsyncAttrSupportPlugin.prototype.apply = function(compiler) { | |
compiler.plugin('this-compilation', function(compilation) { | |
compilation.mainTemplate.plugin('bootstrap', function(source) { | |
return this.asString([ | |
source, | |
'', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ScriptAsyncAttrSupportPlugin() {} | |
module.exports = ScriptAsyncAttrSupportPlugin; | |
ScriptAsyncAttrSupportPlugin.prototype.apply = function(compiler) { | |
compiler.plugin('this-compilation', function(compilation) { | |
compilation.mainTemplate.plugin('bootstrap', function(source) { | |
return this.asString([ | |
source, | |
'', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Something like this. I haven't tested this file | |
@Injectable() | |
export class ApiService { | |
constructor(public _http: Http, public _cache: Cache) { | |
} | |
// whatever domain/feature method name | |
getModel(url) { | |
// you want to return the cache if there is a response in it. This would cache the first response so if your API isn't idempotent you probably want to remove the item from the cache after you use it. LRU of 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(A,n,g,u,l,a,r){A.GoogleAnalyticsObject=r;A[l]=A[l]||function(){ | |
(A[l].q=A[l].q||[]).push(arguments)},A[l].l=1*new Date();a=n.createElement(g), | |
r=n.getElementsByTagName(g)[0];a.async=1;a.src=u;r.parentNode.insertBefore(a,r) | |
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'UA-XXXXXXXX-XX', 'auto'); | |
ga('send', 'pageview'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%YAML 1.2 | |
--- | |
# http://www.sublimetext.com/docs/3/syntax.html | |
name: Angular 2 | |
file_extensions: | |
- ts | |
scope: source.ts | |
contexts: | |
main: | |
- include: expression |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>index as a string</title> | |
</head> | |
<body> | |
<app> | |
Loading... |
I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.
So it might be really unintuitive at first but lambda functions have three states.
- No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
- VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
- VPC with NAT, The best of both worlds, AWS services and web.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Some experiments with a Picture type based on an attribute-grammar | |
-- model of Layout | |
module FunPic where | |
import Haven | |
-- A type for representing the dimensions of a rectangle, as (width,height) | |
type Dimension = (Double,Double) |
Compile with:
webpack --config vendor.webpack.config.js
webpack --config app.webpack.config.js
Use with the following index.html