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
# Write code that implements the scoring and rules for a simplified | |
# single-player blackjack game. Aim to make your code easy to | |
# re-use by other developers. | |
# Required functionality:: | |
# Draw card | |
# See current hand | |
# Get score of current hand | |
# Get score for an explicitly defined hand |
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/bash | |
#build a docker image from your current directory | |
#name it gios, tag is v1 | |
docker build -t gios:v1 . |
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/bash | |
# Start docker container (--cap-add=SYS_PTRACE allows for gdb, --security-opt seccomp=unconfined for this error message : warning: Error disabling address space randomization: Operation not permitted) | |
#jwtGT env variable is your 2factor jwt token. I am setting it as an env variable in your container | |
#Make sure to set an env variable on your system to jwtGT and assign the value of the jwt token from Georgia Tech: https://bonnie.udacity.com/auth_tokens/two_factor | |
docker run --cap-add=SYS_PTRACE \ | |
--security-opt seccomp=unconfined \ | |
-e jwtGT=$jwtGT \ | |
-it gios:v1 /bin/bash |
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
FROM udacity/project-assistant-base:3.0 | |
MAINTAINER fsgeek@gatech.edu | |
ARG develop | |
ARG gpgkeyfile | |
ENV DEBIAN_FRONTEND=noninteractive | |
RUN wget -O - https://ppa.bitanical.com/pward8@gatech.edu.gpg.key|apt-key add - && \ | |
echo "deb https://ppa.bitanical.com/apt/debian bionic main" >> /etc/apt/sources.list.d/ppa.bitanical.list |
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
################### Generate a secrey key ################### | |
# First generate your own secret key. | |
## Add code here to generate your own secret key | |
# Python: https://blog.miguelgrinberg.com/post/the-new-way-to-generate-secure-tokens-in-python | |
# Nodejs: https://stackoverflow.com/questions/8855687/secure-random-token-in-node-js (Make sure to change it to 25-35 characters) | |
#################### Get API Key ################### | |
# Next, send a post request with your secret key, which will return a api key |
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 requests | |
def count_keys(data): | |
total = 0 | |
for i in data: | |
total += 1 | |
if type(data[i]) is dict: | |
total += count_keys(data[i]) | |
elif type(data[i]) is list: |