Skip to content

Instantly share code, notes, and snippets.

View frankzickert's full-sized avatar

Frank Zickert frankzickert

View GitHub Profile
@frankzickert
frankzickert / spa_domain.tsx
Last active May 3, 2019 12:44
SinglePageApp with Domain
/** src/index.tsx */
export default (
<SinglePageApp
stackName = "iclp"
buildPath = 'build'
region='eu-west-1'>
<Environment
name="prod"
domain="www.infrastructure-components.com"
@frankzickert
frankzickert / iam_policy.json
Created May 3, 2019 12:47
The AWS IAM policy required of Infrastructure-Components
{
"Statement": [
{
"Action": [
"s3:*",
"apigateway:*",
"lambda:*",
"logs:*",
"cloudformation:*",
"cloudfront:*",
@frankzickert
frankzickert / spa.tsx
Last active May 7, 2019 08:36
A simple SinglePageApp
/** src/index.tsx */
import * as React from 'react';
import {
Environment,
Route,
SinglePageApp
} from "infrastructure-components";
export default (
@frankzickert
frankzickert / serverless.yml
Last active May 7, 2019 06:51
An excerpt of a serverless configuration file
provider:
region: eu-west-1
stackName: ${self:service.name}-${self:provider.stage, env:STAGE, 'dev'}
environment:
STAGE: ${self:provider.stage, env:STAGE, 'dev'}
DOMAIN_URL: { "Fn::Join" : ["", [" https://#{ApiGatewayRestApi}", ".execute-api.eu-west-1.amazonaws.com/${self:provider.stage, env:STAGE, 'dev'}" ] ] }
TABLE_NAME: ${self:service}-${self:provider.stage, env:STAGE, 'dev'}-data-layer
iamRoleStatements:
- Effect: Allow
Action:
@frankzickert
frankzickert / isomorphic.tsx
Last active September 6, 2019 08:54
A simple Isomorphic React App
import * as React from 'react';
import {
Environment,
IsomorphicApp,
Middleware,
Route,
WebApp,
} from "infrastructure-components";
/** src/index.tsx */
import * as React from 'react';
import {
Environment,
Route,
SinglePageApp
} from "infrastructure-components";
import App from './App';
@frankzickert
frankzickert / map-example.js
Last active July 19, 2019 13:05
map-example
/** input array */
const arrInput = [1,4,2];
/********* with Array.map ***************/
const arrMap = arrInput.map(cur=>cur+2);
/********* with for-loop ****************/
const arrOutput = new Array();
for (var i in arrInput) {
/** input array */
const arrInput = [1,4,2];
/** prepare an output array */
const arrOutput = new Array();
/** loop through the index of the input array */
for (var idx in arrInput) {
/** add to the output array ... */
arrOutput.push(
const App = () => {
return <BrowserRouter>
<Route path="/" render={() => <Home />} />
<Route path="/dashboard" render={() => <Dashboard />} />
</BrowserRouter>
}
"scripts": {
"build": "webpack --config webpack.config.js",
"deploy": "npm run build && sls deploy && s3sync"
}