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: "1" | |
services: | |
dynamodb_local: | |
container_name: "dynamodb_local" | |
image: "amazon/dynamodb-local:latest" | |
ports: | |
- "8000:8000" | |
command: | |
["-jar", "DynamoDBLocal.jar", "-sharedDb", "-dbPath", /tmp/dynamolocal] | |
volumes: |
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 readline = require('readline'); | |
const fs = require('fs'); | |
const sleep = ms => { | |
return new Promise(resolve => setTimeout(resolve, ms)) | |
} | |
(async () => { | |
var lineReader = readline.createInterface({ | |
input: fs.createReadStream(`${__dirname}/schedule.txt`), |
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 validator = require('validator'); | |
const UUIDv4Error = 'Invalid UUIDv4'; | |
const validateUUIDv4 = value => validator.isUUID(value, 4); | |
exports.UUIDv4 = new GraphQLScalarType({ | |
name: 'UUIDv4', | |
description: 'Valid UUIDv4', |
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": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "PublicReadGetObject", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": [ | |
"s3:GetObject" | |
], |
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 fs = require('fs'); | |
const parse = require('csv-parse'); | |
/** | |
* Retrieve data to process | |
* | |
* @return {Promise} | |
*/ | |
const getData = (csvFilenameToParse) => { | |
return new Promise((resolve, reject) => { |
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 STREAM_NAME = 'ssullivan-kinesis-fu'; | |
const REGION = 'us-west-2'; | |
const AWS = require('aws-sdk'); | |
const kinesis = new AWS.Kinesis({ region: REGION }); | |
const getRecordsFromShard = async (streamName) => { | |
const { Shards: [ { ShardId: shardId } ] } = await kinesis.listShards({ 'StreamName': streamName }).promise(); |
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 _ = require('lodash'); | |
const dynamoEndpoint = 'http://localhost:8000'; | |
console.log(`Establishing connection to local dynamo with endpoint: ${dynamoEndpoint}`); | |
const dynamoDBClient = new AWS.DynamoDB({ | |
endpoint: dynamoEndpoint | |
}); |
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, { Component } from 'react'; | |
import ReactDOM from 'react-dom'; | |
class Car extends Component { | |
state = { | |
direction: null | |
}; | |
constructor(props) { | |
super(props); |
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 results = await items.reduce(async (previousPromise, item) => { | |
const collection = await previousPromise; | |
try { | |
const result = await doSomethingAsync(item); | |
collection.successes.push(result); | |
} catch(e) { | |
collection.errors.push(e); | |
} |
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'); | |
AWS.config.setPromisesDependency(require('Q').Promise); | |
const _ = require('lodash'); | |
const moment = require('moment'); | |
const kinesis = new AWS.Kinesis({region: 'us-east-1'}); | |
const streamName = 'my-stream'; |
NewerOlder