Skip to content

Instantly share code, notes, and snippets.

View julia-git's full-sized avatar

Julia Kho julia-git

  • San Francisco, CA
View GitHub Profile
@julia-git
julia-git / CSScolors.csv
Last active January 9, 2022 23:21
CSS Names Colors
Keyword RGB hex value
black #000000
silver #c0c0c0
gray #808080
white #ffffff
maroon #800000
red #ff0000
purple #800080
fuchsia #ff00ff
green #008000
veg_dict = {'cabbage': 3.57, 'carrot': 2.99, 'spinach': 4.13, 'asparagus': 3.56, 'artichoke': 4.00, 'lettuce': 3.83}
fruit_dict = {'peach': 0.65, 'banana': 0.23, 'watermelon': 2.45, 'apple': 0.99, 'dragonfruit': 1.23}
store_dict = {**veg_dict, **fruit_dict}
order1 = {'cabbage': 3, 'spinach' : 3, 'artichoke': 5, 'apple': 10, 'banana': 7}
order2 = {'dragonfruit': 10, 'apple': 4, 'lettuce': 2}
order1_total = 0
order2_total = 0
@julia-git
julia-git / veggies2.Py
Created August 14, 2021 21:49
veggies + fruits
veg_dict = {'cabbage': 3.57, 'carrot': 2.99, 'spinach': 4.13, 'asparagus': 3.56, 'artichoke': 4.00, 'lettuce': 3.83}
fruit_dict = {'peach': 0.65, 'banana': 0.23, 'watermelon': 2.45, 'apple': 0.99, 'dragonfruit': 1.23}
store_dict = {**veg_dict, **fruit_dict}
order1 = {'cabbage': 2, 'spinach' : 3, 'artichoke': 5, 'apple': 10, 'banana': 7}
order_total = 0
for item, quantity in order1.items():
order_total += store_dict[item] * quantity
@julia-git
julia-git / veggies.Py
Created August 14, 2021 21:36
veggies
veg_dict = {'cabbage': 2.87, 'carrot': 1.59, 'spinach': 3.33, 'asparagus': 2.54, 'artichoke': 3.00, 'lettuce': 2.43}
order1 = {'cabbage': 2, 'spinach' : 3, 'artichoke': 5}
order_total = 0
for veggie, quantity in order1.items():
order_total += veg_dict[veggie] * quantity
print(order_total)
@julia-git
julia-git / webscraping_nyc_mta.py
Last active January 22, 2023 15:55
webscraping_nyc_mta
# Import libraries
import requests
import urllib.request
import time
from bs4 import BeautifulSoup
# Set the URL you want to webscrape from
url = 'http://web.mta.info/developers/turnstile.html'
# Connect to the URL
@julia-git
julia-git / word_cloud_function.py
Created September 5, 2018 21:59
word_cloud_function
def generate_wordcloud(words, mask):
word_cloud = WordCloud(width = 512, height = 512, background_color='white', stopwords=STOPWORDS, mask=mask).generate(words)
plt.figure(figsize=(10,8),facecolor = 'white', edgecolor='blue')
plt.imshow(word_cloud)
plt.axis('off')
plt.tight_layout(pad=0)
plt.show()
@julia-git
julia-git / gist:feb6253187b05aa9071c1c0721488f60
Last active December 17, 2019 05:10
generate_wordcloud
from wordcloud import WordCloud, STOPWORDS
from PIL import Image
import urllib
import requests
import numpy as np
import matplotlib.pyplot as plt
words = 'access guest guest apartment area area bathroom bed bed bed bed bed bedroom block coffee coffee coffee coffee entrance entry francisco free garden guest home house kettle kettle kitchen kitchen kitchen kitchen kitchen kitchenliving located microwave neighborhood new park parking place privacy private queen room san separate seperate shared space space space street suite time welcome'
mask = np.array(Image.open(requests.get('http://www.clker.com/cliparts/O/i/x/Y/q/P/yellow-house-hi.png', stream=True).raw))