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
<template> | |
<video | |
id="my-player" class="video-js vjs-16-9" controls preload="auto" width="100%"> | |
</video> | |
</template> | |
<script> | |
import videojs from '@mux/videojs-kit'; | |
import '@mux/videojs-kit/dist/index.css'; |
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 os | |
from datetime import datetime | |
from urllib.request import Request, urlopen | |
SITE = os.environ['site'] # URL of the site to check, stored in the site environment variable | |
EXPECTED = os.environ['expected'] # String expected to be on the page, stored in the expected environment variable | |
def validate(res): | |
'''Return False to trigger the canary |
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", |
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
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
'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
'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
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
# ./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(' ') |
NewerOlder