This file contains hidden or 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
| const lambda_handler = require('lambda-handler'); | |
| exports.handler = lambda_handler(( event, ctx, done ) => { | |
| // This will log a handled error to CloudWatch and return the error to AWS Lambda | |
| throw 'BOOM!'; | |
| }); |
This file contains hidden or 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
| "scripts": { | |
| "build": "yarn icons:crush && yarn icons:to-jsx && yarn diagrams:crush && yarn diagrams:to-jsx", | |
| "icons:crush": "svgo --pretty --indent=2 -f ./icons/assets", | |
| "icons:to-jsx": "babel-node --presets=react,es2015 ./scripts/svg-to-jsx.js ./icons/assets ./icons", | |
| "diagrams:crush": "svgo --pretty --indent=2 -f ./diagrams/assets", | |
| "diagrams:to-jsx": "babel-node --presets=react,es2015 ./scripts/svg-to-jsx.js ./diagrams/assets ./diagrams" | |
| } |
This file contains hidden or 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
| import { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { |
This file contains hidden or 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
| // Simple proxy/forwarding server for when you don't want to have to add CORS during development. | |
| // Usage: node proxy.js | |
| // Open browser and navigate to http://localhost:9100/[url] | |
| // Example: http://localhost:9100/http://www.google.com | |
| // This is *NOT* for anything outside local development. It has zero error handling among other glaring problems. | |
| // This started as code I grabbed from this SO question: http://stackoverflow.com/a/13472952/670023 |
This file contains hidden or 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
| // https://developer.mozilla.org/en-US/docs/Web/API/window.setTimeout | |
| var timeoutID; | |
| delayedAlert(); | |
| function delayedAlert() { | |
| timeoutID = window.setTimeout(slowAlert, 2000); | |
| } | |
| function slowAlert() { |
NewerOlder