View BaseStack.ts
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
import { StackProps, Stack, Construct, Tag } from '@aws-cdk/core' | |
export class BaseStack extends Stack { | |
constructor(scope: Construct, id: string, props: StackProps) { | |
super(scope, id, props); | |
const { tags } = props; | |
// Make sure everything is tagged | |
Object.entries(tags).forEach(([name, value]) => { |
View cors_handler.js
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
// cors_handler.js | |
const ALLOW_HEADERS = [ | |
'Content-Type', | |
'X-Amz-Date', | |
'Authorization', | |
'X-Api-Key', | |
'X-Amz-Security-Token' | |
]; |
View bind_all_methods.js
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
// Usage: | |
// | |
// import bindAllMethods from 'bind_all_methods'; | |
// import React from 'react'; | |
// | |
// class MyComponent extends bindAllMethods(React.Component) { | |
// ... | |
// } | |
// | |
export default function bindAllMethods(BaseComponent) { |
View lambdaExplorer.js
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
'use strict'; | |
exports.handler = (event, context, callback) => { | |
callback(null, { | |
statusCode: 200, | |
headers: { | |
'Content-Type': 'application/json' | |
}, | |
body: JSON.stringify({ | |
event: event, |
View .gitconfig
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
[alias] | |
addnw = !bash -c 'git diff -U0 -w --no-color $@ | git apply --cached --ignore-whitespace --unidiff-zero -' |