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
echo "# matisa-serverless" >> README.md | |
git init | |
git add README.md | |
git commit -m "first commit" | |
git remote add origin https://github.com/kilgarenone/matisa-serverless.git | |
git push -u origin master |
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 axios = require("axios"); | |
const mailChimp = { | |
preLaunchListId: "ff8c031f0e", // you can find yours in your mailchimp dashboard | |
apiUrl: "https://us2.api.mailchimp.com/3.0/" // this too | |
}; | |
module.exports.addToBetaUserList = function(event, context, callback) { | |
const body = JSON.parse(event.body); // accessing the POST body payload. yours might have different structure and names | |
const auth = { |
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 slsw = require('serverless-webpack'); | |
const nodeExternals = require('webpack-node-externals'); | |
module.exports = { | |
entry: slsw.lib.entries, | |
target: 'node', | |
// Generate sourcemaps for proper error messages | |
devtool: 'source-map', | |
// Since 'aws-sdk' is not compatible with webpack, | |
// we exclude all node dependencies |
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
{ | |
"plugins": ["source-map-support"], | |
"presets": [ | |
[ | |
"@babel/preset-env", | |
{ | |
"targets": { | |
"node": "8.10" | |
} | |
} |
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 ICONS = { | |
CLOSE: | |
"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z", | |
ARROW_RIGHT: | |
"m 13.706875,17.707 5,-5 c 0.391,-0.39 0.391,-1.024 0,-1.414 l -5,-4.9999998 c -0.391,-0.391 -1.024,-0.391 -1.414,0 -0.39,0.391 -0.391,1.024 0,1.414 L 15.585875,11 H 5.9998748 c -0.552,0 -1,0.448 -1,1 0,0.552 0.448,1 1,1 h 9.5860002 l -3.293,3.293 c -0.195,0.195 -0.293,0.451 -0.293,0.707 0,0.256 0.098,0.512 0.293,0.707 0.391,0.391 1.024,0.391 1.414,0 z" | |
}; | |
export default ICONS; |
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 React from "react"; | |
import { css, cx } from "react-emotion"; | |
const defaultSvgCss = css` | |
position: relative; | |
display: inline-block; | |
vertical-align: middle; | |
`; | |
function Icon({ icon, color, size = 24, className }) { |
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
// Function as children pattern | |
// Notice below that the body/children of <Hello /> is a anonymous function definition! | |
<Hello> | |
{ (foo) => (<World foo={foo} />) } | |
</Hello> | |
/* | |
And then we execute the function - this.props.children(), | |
while passing it the 'foo' data as an argument to the function above- | |
(foo) => (<World foo={foo} />), giving us whatever view is rendered inside the <World />! |
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
class Hello extends React.Component { | |
state = { isSubmitting: false } | |
handleThisClick = () => { | |
/* do your thing here */ | |
} | |
handleFormSubmit = async event => { | |
event.preventDefault(); | |
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
// destructure the object given when called in the <Hello />, | |
// then pass those properties to our <CustomComponent /> to be consumed. | |
// The 'isSubmitting' value will be toggled and consumed accordingly too! | |
<Hello> | |
{({ | |
handleThisClick, | |
handleFormSubmit, | |
isSubmitting | |
}) => ( | |
<CustomComponent |
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
@font-face { | |
font-family: "fontello"; | |
src: url("./font/fontello.woff2") format("woff2"), | |
url("./font/fontello.woff") format("woff"), | |
url("./font/fontello.ttf") format("truetype"), | |
url("./font/fontello.svg") format("svg"); | |
font-weight: normal; | |
font-style: normal; | |
} |