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
| FROM amazonlinux:1 | |
| WORKDIR /tmp | |
| #install the dependencies | |
| RUN yum -y install gcc-c++ && yum -y install findutils | |
| RUN touch ~/.bashrc && chmod +x ~/.bashrc | |
| RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash |
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 doesKeyExist = key => S3.headObject({ | |
| Bucket: options.bucketName, | |
| Key: key.replace(/^\/+/, '') | |
| }) | |
| .promise() | |
| .then(data => true) | |
| .catch(err => err.statusCode === 404 ? false : throw err); |
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
| Transform: AWS::Serverless-2016-10-31 | |
| Resources: | |
| Lambda: | |
| Type: AWS::Serverless::Function | |
| Properties: | |
| Runtime: nodejs8.10 | |
| InlineCode: | | |
| exports.handler = (event, ctx, cb) => { | |
| console.log(JSON.stringify(event)); |
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 { useState, useEffect, useRef, useCallback } from 'react'; | |
| import useThrottledOnScroll from './useThrottledOnScroll'; | |
| const useScrollSpy = ({ items = [], target = window } = {}) => { | |
| const itemsWithNodeRef = useRef([]); | |
| useEffect(() => { | |
| itemsWithNodeRef.current = getItemsClient(items); | |
| }, [items]); | |
| const [activeState, setActiveState] = useState(null); |
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
| # Place this file in the route of your S3 bucket | |
| # https://www.npmjs.com/package/middy-reroute | |
| # Redirect with 301 | |
| /home / | |
| /google https://www.google.com | |
| # Redirect with 302 | |
| /my-redirect / 302 | |
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
| # From: | |
| - service: ozw.set_config_parameter | |
| data: | |
| node_id: 23 | |
| parameter: 14 | |
| value: Red | |
| # To: | |
| - service: zwave_js.set_config_parameter | |
| target: |
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 reqHSContactByEmail = async (email, retryNum = 0) => { | |
| expect(retryNum).to.be.lessThan(10) | |
| return cy | |
| .request({ | |
| url: `${HUBSPOT_CONTACT_API(email)}?hapikey=${Cypress.env( | |
| 'HUBSPOT_API_KEY' | |
| )}`, | |
| failOnStatusCode: false, | |
| }) | |
| .then((resp) => { |
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 deployment1 = new s3deploy.BucketDeployment(this, 'BucketDeployment1', { | |
| sources: [ | |
| s3deploy.Source.asset(props.siteAssetsPath, { | |
| ignoreMode: cdk.IgnoreMode.GIT, | |
| exclude: ['*.*', '!*.js', '!*.css', 'sw.js', '!static/**', '_redirects'], | |
| }), | |
| ], | |
| memoryLimit: 512, | |
| cacheControl: [s3deploy.CacheControl.fromString('public,max-age=31536000,immutable')], | |
| destinationBucket: primaryBucket, |
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 * as sst from '@serverless-stack/resources' | |
| import * as iam from '@aws-cdk/aws-iam' | |
| import * as apigw from '@aws-cdk/aws-apigatewayv2' | |
| export default class MyStack extends sst.Stack { | |
| constructor(scope: sst.App, id: string, props?: sst.StackProps) { | |
| super(scope, id, props) | |
| const { account, region } = scope |
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 { Handler } from 'aws-lambda' | |
| import { ApolloServer } from 'apollo-server-lambda' | |
| import { makeExecutableSchema, mergeSchemas } from '@graphql-tools/schema' | |
| import { introspectSchema, wrapSchema } from '@graphql-tools/wrap' | |
| import { AsyncExecutor } from '@graphql-tools/utils' | |
| import { fetch } from 'cross-fetch' | |
| import { printSchema, print } from 'graphql' | |
| const { CONTENTFUL_CDA, CONTENTFUL_SPACE } = process.env |