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 random | |
import sys | |
# parallel lists, potential_words & potential_words_type. The word and it's type respectively. | |
potential_words = ["League of legends", "Gone Girl", "Runescape"] | |
potential_words_type = ["Game", "Movie", "Game"] | |
letters_to_guess = {} | |
# revealed_indicies list is used to check whether the certain index of the word has been guessed |
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
// ES6 import right from node modules | |
// Parcel js will take care of bundling this for us so it's web ready. | |
import md5 from 'md5' | |
export function transform() { | |
document.getElementById('md5-output').value = md5(document.getElementById('md5-input').value); | |
} |
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
class NumberTuple(tuple): | |
''' | |
NumberTuple is a tuple class that wishes to convert | |
string number to a tuple. | |
''' | |
def __init__(self, number): | |
''' | |
While our goal is to convert the string number |
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
class Medium(object): | |
def __init__(self, username, age, interests): | |
self.username = username | |
self.age = age | |
self.interests = interests | |
def __str__(self): | |
''' | |
We swap the default string output of this class with an informative |
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
class Medium(object): | |
def __init__(self, username, age, interests): | |
self.username = username | |
self.age = age | |
self.interal_id=2939 | |
self.interests = interests | |
def __str__(self): | |
''' |
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
class DPVector(tuple): | |
''' | |
Dot Product (DP) Vector class that overrides the __mul__ | |
implementation to perform dot product operation! | |
''' | |
def __init__(self, tup): | |
self.tup = tup | |
def __mul__(self, other): | |
''' |
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 "./node_modules/rfs/scss.scss"; | |
body { | |
margin: 0; | |
} | |
#content-container { | |
display: flex; | |
height: 100vh; | |
flex-direction: column; |
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
const fortunes = [ | |
"A beautiful, smart, and loving person will be coming into your life.", | |
"A dubious friend may be an enemy in camouflage.", | |
"A faithful friend is a strong defense.", | |
"A feather in the hand is better than a bird in the air.", | |
"A fresh start will put you on your way.", | |
"A friend asks only for your time not your money." | |
]; | |
/** |
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
export function requestFortune() { | |
fetch('https://a9vymko126.execute-api.ca-central-1.amazonaws.com/test', { method: "GET" }) | |
.then(response => response.json()) | |
.then(data => document.getElementById('fortune-text').innerHTML = data) | |
} |
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
service: FortuneCookie | |
provider: | |
name: aws | |
runtime: nodejs12.x | |
profile: myaws | |
region: ca-central-1 | |
stackName: fortune-backend | |
package: |
OlderNewer