Open index.html, click the input field and eat the food with the arrow keys.
This file contains 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
# Validates Uploaded CSVs to S3 | |
import boto3 | |
import csv | |
import pg8000 | |
EXPECTED_HEADERS = ['header_one', 'header_two', 'header_three'] | |
def get_csv_from_s3(bucket_name, key_name): | |
"""Download CSV from s3 to local temp storage""" | |
# Use boto3 to connect to S3 and download the file to Lambda tmp storage |
This file contains 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
#!/usr/bin/env python | |
# Python Script to swap AWS Profile configs | |
# Assumes that credentials file is at ~/.aws/credentials | |
import argparse | |
import ConfigParser | |
import os | |
Config = ConfigParser.ConfigParser() |
This file contains 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/pyspark | |
# Assumes headers are not present in files that are processed | |
# This is meant to run locally. To easily verify it works you can: | |
# 1. `pip install pyspark` | |
# 2. startup pyspark: ./bin/pyspark | |
# 3. copy data similar to the data provided above in the document | |
# 4. Copy and paste the code into the repl | |
def cleaner(s): | |
return str(s).replace('"','').strip(' ') |
This file contains 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 csv | |
import json | |
# Define the header names so we can specify them when reading the CSV | |
fieldnames = ( | |
"STATION","NAME","DATE","AWND","PRCP","SNOW","SNWD", | |
"TAVG","TMAX","TMIN","WT01","WT02","WT03","WT05","WT08" | |
) | |
# Open both files so we can interact with them |
This file contains 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
'use strict'; | |
const AWS = require('aws-sdk'); | |
module.exports.create = (event, context, callback) => { | |
const timestamp = new Date().getTime(); | |
const data = JSON.parse(event.body); | |
var params = { | |
TableName: "customerTable", | |
Item: { |
This file contains 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
'use strict'; | |
const AWS = require('aws-sdk'); | |
module.exports.create = (event, context, callback) => { | |
const timestamp = new Date().getTime(); | |
const data = JSON.parse(event.body); | |
var params = { | |
TableName: process.env.TABLE_NAME, | |
Item: { |
This file contains 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 time | |
import boto3 | |
dynamodb = boto3.client('dynamodb') | |
source_table_name = "customerTable" # Or whatever your source table name is | |
dest_table_name = "customerTable-dev" # This should be an empty table - the script will delete it first | |
backup_name = source_table_name + "backupMigration" # Or any other backup name | |
# Create the backup |
This file contains 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 boto3 | |
from pprint import pprint | |
from bullet import Bullet, Input, styles, VerticalPrompt, Check, YesNo | |
# List Route 53 domains | |
r53domains = boto3.client('route53domains') | |
response = r53domains.list_domains() | |
domain_list = [] | |
for domain in response["Domains"]: |
This file contains 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
[ | |
{ | |
"artist": "Romero Allen", | |
"song": "Atomic Dim", | |
"id": "b4b0da3f-36e3-4569-b196-3ad982f72bbd", | |
"priceUsdCents": 392, | |
"publisher": "QUAREX" | |
}, | |
{ | |
"artist": "Hilda Barnes", |
OlderNewer