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
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
version: "2" | |
services: | |
server: | |
image: webpagetest/server:latest | |
volumes: | |
- ./server/locations.ini:/var/www/html/settings/locations.ini | |
agent: | |
image: webpagetest/agent:latest | |
environment: |
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
var AWS = require('aws-sdk'); | |
var elastictranscoder = new AWS.ElasticTranscoder(); | |
var Create = function(params, reply) { | |
elastictranscoder.createPipeline(params, function(err, data) { | |
if (err) { | |
console.error(err); | |
reply(err); | |
} else { |
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
Resources: | |
WebACL: | |
Type: "AWS::WAF::WebACL" | |
Properties: | |
DefaultAction: | |
Type: BLOCK | |
MetricName: "TrustedIPs" | |
Name: "TrustedIPs" | |
Rules: | |
- Action: |
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 path = require('path'); | |
const { STATUS_CODES } = require('http'); | |
exports.rewriteHandler = (evt, ctx, cb) => { | |
const { request } = evt.Records[0].cf; | |
const htmlExtRegex = /(.*)\.html?$/; | |
if (htmlExtRegex.test(request.uri)) { | |
const uri = request.uri.replace(htmlExtRegex, '$1'); | |
return cb(null, redirect(uri)); | |
} |
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
service: service-name | |
provider: | |
name: aws | |
runtime: nodejs6.10 | |
region: us-east-1 | |
functions: | |
hello: | |
handler: handler.hello |
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 AWS = require('aws-sdk'); | |
const ssm = new AWS.SSM({ apiVersion: '2014-11-06' }); | |
exports.handler = (event, context, cb) => { | |
ssm | |
.getParameter({ Name: 'awesomeParam' }) | |
.promise() | |
.then(resp => { | |
const value = resp.Parameter.Value; | |
cb(null, `Success: the param value is ${value}`); |
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
--- | |
Type: "AWS::SSM::Parameter" | |
Properties: | |
Name: awesomeParam | |
Description: A Great Param | |
Type: String | |
Value: {Ref: SomeResourceID} |
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, { PropTypes } from 'react'; | |
import cx from 'classnames'; | |
class TranscriptTextHighlighter extends React.Component { | |
constructor() { | |
super(); | |
this.state = { | |
activeIndex: 3, |