Skip to content

Instantly share code, notes, and snippets.

View pamelafox's full-sized avatar

Pamela Fox pamelafox

View GitHub Profile
import dis
def for_version():
y = 0
for x in [1, 2, 3]:
y += x * 2
def iter_version():
_gen_ = iter([1, 2, 3])
y = 0
@pamelafox
pamelafox / pairing.py
Last active January 12, 2021 23:54
Pairing aging distant pop stars
""" Check your work by running python -m doctest -v popstar.py """
def gen_popstar_name(last_name, street, last_food):
"""Your pop star name is your last name followed
by the name of the street your grew up on followed
by the last food you ate.
The only whitespace should be between each of the
three parts, and the name should be uppercase.
>>> gen_popstar_name("fox", "city lights", "bananas")
@pamelafox
pamelafox / fibonacci.html
Created September 17, 2020 22:03
Animated Fibonacci SVG
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Fibonacci (Animated)</title>
<style>
body {
background: #f3f3f3;
}
@pamelafox
pamelafox / astronauts.sql
Created March 20, 2020 18:24
NASA astronauts, 1959-Present
/* Source:
https://www.kaggle.com/nasa/astronaut-yearbook
*/
CREATE TABLE astronauts(
Name TEXT PRIMARY KEY,
Year INTEGER,
GroupNum INTEGER,
Status TEXT,
Birth_Date TEXT,
Birth_Place TEXT,
@pamelafox
pamelafox / nba_players.sql
Created March 20, 2020 18:17
NBA players of the week
/*
Source:
https://www.kaggle.com/jacobbaruch/nba-player-of-the-week
*/
CREATE TABLE players(
Player TEXT,
Team TEXT,
Conference TEXT,
Date TEXT,
Position TEXT,
@pamelafox
pamelafox / pokemon.sql
Created March 20, 2020 16:51
Pokemon statistics
CREATE TABLE pokemon(
Number INTEGER,
Name TEXT PRIMARY KEY,
Type_1 TEXT,
Type_2 TEXT,
Total INTEGER,
HP INTEGER,
Attack INTEGER,
Defense INTEGER,
Sp_Atk INTEGER,
@pamelafox
pamelafox / superbowls.sql
Created March 20, 2020 16:40
Superbowls 1967-2020 (Winners and losers of all Superbowl finals)
CREATE TABLE superbowls(
Date TEXT PRIMARY KEY,
SB TEXT,
Winner TEXT,
Winner_Pts INTEGER,
Loser TEXT,
Loser_Pts INTEGER,
MVP TEXT,
Stadium TEXT,
City TEXT,
@pamelafox
pamelafox / additional_symbols.go
Created October 14, 2019 17:40
Additional symbols
{50, "L"},
{40, "XL"},
@pamelafox
pamelafox / hosts
Created July 23, 2018 15:04
etc/hosts for news blocking
### News Aggregators
127.0.0.1 redditate.com
127.0.0.1 news.google.com
127.0.0.1 news.yahoo.com
127.0.0.1 news.ycombinator.com
### News
127.0.0.1 cnn.com
127.0.0.1 recode.net
127.0.0.1 techcrunch.com
127.0.0.1 mashable.com
@pamelafox
pamelafox / scraper_pickup.py
Last active August 31, 2020 11:23
Scrapers
from bs4 import BeautifulSoup
import requests
import string
def save_to_file(filename, sayings):
file = open(filename, "w")
file.write("\n".join(sayings).encode("utf-8"))
file.close()