- DistantLife
- Day 12: Update database connections to use sqlite3
- Day 14: Updated python server & updated code on production to use sqlite3
- Storybook
- Day 22: Overview
- Day 25: Setup and add-ons
- Python Testing
- Day 13: Unit Testing
- Day 19: Test Fixtures
- Day 21: Test Structure
- AWS Cloud Practitioner Certification
- Fundamental Cloud Concepts ✓
- Day 01: Account setup
- Day 02: Cloud Computing, AWS Global Infrastructure
- Day 03: Understanding Cloud Economics, Supporting AWS Infrastructure ✓
- Understanding AWS Core Services ✓
- Day 05: Interacting with AWS, Compute Services
- Day 06: Content and Network Delivery Services, File Storage Services, Database Services and Utilities, App Integration Services
- Day 07: Management and Governance Services ✓
- Introduction to Security and Architecture on AWS ✓
- Day 08: AWS Architecture Core Concepts
- Day 09: AWS Identities and User Management
- Day 10: Data Architecture on AWS
- Day 11: Disaster Recovery on AWS, Architecting Applications on Amazon EC2 ✓
- Fundamental Cloud Concepts ✓
- Codewars
- Day 04: Greed is Good (Python) ✓
- Reviewed Storybook setup and add-ons
- Tried playing with Blast (Laravel Blades) but I don't have php artisan set up
Examples
It's a tool for creating isolated UI components
May be known as:
- A living styleguide
- Component library
How it works:
- It renders components in an iframe
- Shows you how it works / looks
- Knobs: add-on that let's you update parameters pased to component (text)
- Show Info: add-on used by Airbnb to show dev docs / params
Getting Started
/components
- React components, etc- Add stories (
/.storybook
) -npx -p @storybook/cli sb init
npm run storybook
Phonebook tests repo - Test structure: Arrange, act, assert
Phonebook tests repo - add test fixture
Promoted to Senior FED 🎉
Updated python server & updated code on production to use sqlite3
sudo apt-get update
sudo apt-get upgrade
cd /var/www/distantlife.com/html
sudo systemctl stop distantlife
git pull
sudo systemctl start distantlife
- Unit Testing on Python
- Possible flask blog platform - but a bit too much restructuring, newness for me atm
A unit test doesn't use:
- the filesystem
- a database
- the network
DistantLife: change use of cs50
library to sqlite3
for database queries
Was:
from cs50 import SQL
db = SQL("sqlite:///distantlife.db")
Now:
import sqlite3
con = sqlite3.connect("distantlife.db")
con.row_factory = sqlite3.Row # includes column name in return dictionary
db = con.cursor()
Updated:
@app.route("/pets")
@login_required
def pets():
"""Lists all of user's pets"""
- # previously using cs50 db query
- # pets_owned = db.execute("SELECT pets.id, pet_types.imgsrc, pet_types.pet_type, pets.created, pets.exp, pets.name, users.active_pet_id FROM owners JOIN pets ON pets.id = owners.pet_id JOIN pet_types ON pets.type = pet_types.id JOIN users ON users.id = owners.owner_id WHERE owner_id = ?", session_get_int("user_id"))
- # [{'id': 15, 'imgsrc': '/pets/034-jackalope.png', 'pet_type': 'Jackalope', 'created': '2021-12-05 18:04:39', 'exp': 0, 'name': 'Unnamed Pet', 'active_pet_id': 15}]
+ # now, updated using .fetchall and rows magic (above)
+ # also required trailing " , " in list of params
+ pets_owned = db.execute("SELECT pets.id, pet_types.imgsrc, pet_types.pet_type, pets.created, pets.exp, pets.name, users.active_pet_id FROM owners JOIN pets ON pets.id = owners.pet_id JOIN pet_types ON pets.type = pet_types.id JOIN users ON users.id = owners.owner_id WHERE owner_id = ?", (session_get_int("user_id"), )).fetchall()
+ # https://itheo.tech/get-column-names-from-sqlite-with-python
+ # print(dict(pets_owned[0]))
+ # {'id': 15, 'imgsrc': '/pets/034-jackalope.png', 'pet_type': 'Jackalope', 'created': '2021-12-05 18:04:39', 'exp': 0, 'name': 'Unnamed Pet', 'active_pet_id': 15}
return render_template("list.html", pets_owned=pets_owned)
After every UPDATE, INSERT, and DELETE you also need to commit in order to ensure the execution moves from the journal to the database.
Example of updating a row, checking if there was an update with rowcount
and committing the update
updateqry = db.execute(
"UPDATE pets SET exp = ? WHERE id = ?", (exp, active_pet_id))
con.commit()
if (updateqry.rowcount > 0):
session.get("active_pet")["exp"] = exp
return exp
else:
return 0
AWS Cert: Introduction to Security and Architecture on AWS
- Disaster Recovery on AWS
- Architecting Applications on Amazon EC2
AWS Cert: Introduction to Security and Architecture on AWS
- Data Architecture on AWS
AWS Cert: Introduction to Security and Architecture on AWS
- AWS Identities and User Management
AWS Cert: Introduction to Security and Architecture on AWS
- AWS Architecture Core Concepts
AWS Cert: Understanding AWS Core Services
- Management and Governance Services
- AWS CloudTrail
- Amazon CloudWatch and AWS Config
- AWS Systems Manager
- AWS CloudFormation
- AWS OpsWorks
- AWS Organizations and Control Tower
AWS Cert: Understanding AWS Core Services
- Content and Network Delivery Services
- Amazon VPC and Direct Connect
- Amazon Route 53 (DNS)
- Elastic Load Balancing
- Amazon CloudFront (CDN) and API Gateway
- AWS Global Accelerator
- Database Services and Utilities
- RDS
- DynamoDB
- Elasticache
- Redshift
- File Storage Services
- Amazon S3
- Glacier and Glacier Deep Archive
- Elastic Block Store (single EC2)
- Elastic File System (Linux, multi EC2)
- Data Transfer with AWS Snowball, Snowmobile
- App Integration Services
- AWS Messaging Services
- AWS Step Functions
Email: learn and test DMARC (Domain-based Message Authentication, Reporting & Conformance)
AWS Cert: Understanding AWS Core Services
Compute services:
- Amazon EC2 (Elastic Compute Cloud)
- AWS Elastic Beanstalk
- AWS Lambda
Methods of interacting:
- AWS Console
- AWS CLI (see setup below, use IAM user)
- AWS SDK
Setting up AWS CLI, download CLI v2
aws configure --profile ps
AWS Access Key ID [None]: KEY_ID
AWS Secret Access Key [None]: SECRET_KEY
Default region name [None]: us-west-2
Default output format [None]: json
Example, list all S3 buckets:
aws s3 ls --profile ps
- Pluralsight skills:
- CSS: 238; need to work on at-rules, transitions, animations
- Python: 199
- Codewars: Greed is Good
AWS Cert: Fundamental Cloud Concepts
- Understanding Cloud Economics: TCO calc, pricing calc
- Supporting AWS Infrastructure: basic, developer, business, enterprise
AWS Cert: Fundamental Cloud Concepts
- Cloud Computing
- Traditional Data Centers
- Benefits of Cloud Computing
- Types of Cloud Computing
- AWS Global Infrastructure
- AWS Regions
- Availability Zones
- AWS Edge Locations
- Digging into Pluralsight's AWS Cloud Practitioner cert (doing notes in a guide), setup account
- Need to also look into taking the skill assessment for CSS (and SCSS if available?) and see what gaps I have!
Learned that this SCSS syntax works for compiling font styles: (thanks LauraBoemo!)
.myclass {
font: {
family: $theme-font-regular;
size: 16px;
weight: 300;
}
}
Ideas for Round 5 starting February 1, 2022
- CSS Animations / Move Things With CSS (Jhey)
- Built out Distant Life app
- Word images
- Word lists
- Limit abilities to pet levels
- Create "worlds"
- Add another language
- Add test suite for queries
- Javascript30
- Codewars (6kyu, 172)
- Javascript design patterns (MVC)
- Redo Libworx in Python
- App Ideas Collection from florinpop17
- freeCodeCamp
- Play with Storybook or a similar platform for UI
- AWS Cloud Practitioner
- Advanced SCSS
- Make my 100daysofcode nav mobile friendly