type Customer {
id: ID!
email: String!
}
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" : "2017-02-28", | |
"operation" : "PutItem", | |
"key" : { | |
"shopID": $util.dynamodb.toDynamoDBJson($ctx.args.shopID), | |
"vendorID": $util.dynamodb.toDynamoDBJson($ctx.args.vendorID) | |
}, | |
"attributeValues": { | |
"name": $util.dynamodb.toDynamoDBJson($ctx.args.name) | |
}, |
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
--- | |
AWSTemplateFormatVersion: '2010-09-09' | |
Description: > | |
This template creates an Authenticated AppSync API & Resolver Lambda | |
Parameters: | |
pGraphqlDefinition: | |
Description: GraphQL Schema | |
Type: String | |
pFunctionName: | |
Description: Name to Call the Function and Role |
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
--- | |
Description: AWSAppSync DynamoDB Example | |
Resources: | |
GraphQLApi: | |
Type: "AWS::AppSync::GraphQLApi" | |
Properties: | |
Name: AWSAppSync DynamoDB Example | |
AuthenticationType: AWS_IAM | |
PostDynamoDBTableDataSource: |
A quick example demonstrating how to use elasticsearch.js, Bluebird, and AWS Elasticsearch with TypeScript.
You'll need to install a few dependencies and types:
npm install --save @types/elasticsearch @types/http-aws-es elasticsearch http-aws-es bluebird
If you're using AWS Elasticsearch, provide an ES_TYPE
environment variable set to aws
, as well as values for AWS_ACCESS_KEY
, AWS_SECRET_KEY
, and AWS_REGION
. (I make this configurable so it's easy to point applications at a local ES instance when developing/testing locally, and at AWS when deployed to production)
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
/* webpack.config.js */ | |
var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
var CopyWebpackPlugin = require('copy-webpack-plugin'); | |
var path = require('path'); | |
module.exports = { | |
// Tell Webpack which file kicks off our app. | |
entry: path.resolve(__dirname, 'src/index.js'), | |
// Tell Weback to output our bundle to ./dist/bundle.js |
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
// check version | |
node -v || node --version | |
// list locally installed versions of node | |
nvm ls | |
// list remove available versions of node | |
nvm ls-remote | |
// install specific version of node |
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
#!/bin/bash | |
# node-reinstall | |
# credit: http://stackoverflow.com/a/11178106/2083544 | |
## program version | |
VERSION="0.0.13" | |
## path prefix | |
PREFIX="${PREFIX:-/usr/local}" |
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
require 'oauth' | |
# api_key and api_secret values are got from the registration of your application in LinkedIn: | |
# http://developer.linkedin.com/ | |
api_key = 'Your API Key' | |
api_secret = 'Your API Secret' | |
# access_token and token_secret are known after the first execution code block | |
access_token = 'The token we get below' | |
token_secret = 'The token secret we get below' |