This file contains hidden or 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 datetime import datetime | |
from datetime import timedelta | |
import pandas as pd | |
import plotly.express as px | |
import plotly.graph_objs as go | |
import statsmodels.api as sm | |
import math | |
# df = pd.read_csv('owid-covid-data.csv') | |
# df = pd.read_csv('vaccinations.csv') |
This file contains hidden or 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 datetime import datetime | |
from datetime import timedelta | |
import pandas as pd | |
import plotly.express as px | |
import plotly.graph_objs as go | |
import statsmodels.api as sm | |
import math | |
# df = pd.read_csv('owid-covid-data.csv') | |
df = pd.read_csv('vaccinations.csv') |
This file contains hidden or 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 lxml import html | |
string = "" | |
# https://www.oddschecker.com/politics/us-politics/us-presidential-election-2020/winner/bet-history/bernie-sanders#all-history | |
# with open("table-bernie.html", "r") as f: | |
# string = f.read() | |
# https://www.oddschecker.com/politics/us-politics/us-presidential-election-2020/winner/bet-history/joe-biden#all-history | |
# with open("table-biden.html", "r") as f: |
This file contains hidden or 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 lxml import html | |
string = "" | |
# https://www.oddschecker.com/politics/us-politics/us-presidential-election-2020/winner/bet-history/bernie-sanders#all-history | |
# with open("table-bernie.html", "r") as f: | |
# string = f.read() | |
# https://www.oddschecker.com/politics/us-politics/us-presidential-election-2020/winner/bet-history/joe-biden#all-history | |
# with open("table-biden.html", "r") as f: |
This file contains hidden or 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
#!/usr/bin/env python3 | |
import requests | |
import json | |
import os.path | |
import sys | |
import traceback | |
import time | |
# https://www.discogs.com/label/3889-Itiswhatitis-Recordings -> 3889 | |
def url_to_id(url): |
This file contains hidden or 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
#!/usr/bin/env python3.5 | |
# openssl req -x509 -newkey rsa:2048 -keyout selfsigned.key -nodes -out selfsigned.cert -sha256 -days 1000 | |
import socket, ssl, pprint | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
# (TRY #1) require a certificate from the server | |
#ssl_sock = ssl.wrap_socket(s, | |
# ca_certs="selfsigned.cert", |
This file contains hidden or 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
# What it does: you type a command (like vim), then you hit a key | |
# (like ctrl-t), then you make a selection, and the command runs | |
# with your selection as an argument. | |
# The advantage is that you don't have to make a function for each | |
# command that you want to use with selecta. | |
# vs() { vim $(...) } | |
# es() { emacs-client $(...) } | |
# First attempt, not ideal because it leaves your history looking like |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
<title>US colors</title> | |
<script type="text/javascript" src="./d3.v2.js"></script> | |
</head> | |
<body> | |
<div id="chart"></div> | |
<script type="text/javascript" src="geo.js"></script> |
This file contains hidden or 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
# Determine whether a string contains a Social Security number. | |
def has_ssn?(string) | |
string =~ /\d{3}-\d{2}-\d{4}/ | |
end | |
# Return the Social Security number from a string. | |
def grab_ssn(string) | |
string.match(/(\d{3}-\d{2}-\d{4})/) {|m| m[0]} | |
end |
This file contains hidden or 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
# Put your answers here! |
NewerOlder