Skip to content

Instantly share code, notes, and snippets.

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')
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')
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:
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:
#!/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):
#!/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",
@joelanders
joelanders / gist:7312307
Created November 5, 2013 01:21
zsh/zle selecta binding
# 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
@joelanders
joelanders / geo.html
Created November 6, 2012 04:48
Quick United States colorization with D3.
<!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>
# 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
# Put your answers here!