-
Install 1Password CLI and jq.
brew install jq brew cask install 1password-cli
-
Sign in to 1Password for the first time:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import io | |
import csv | |
import zlib | |
import boto3 | |
from tqdm.auto import tqdm | |
s3 = boto3.resource('s3') | |
def iterable_to_stream(iterable, buffer_size=io.DEFAULT_BUFFER_SIZE): | |
""" |
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
# the switch | |
def LEFT(a): | |
def f(b): | |
return a | |
return f | |
def RIGHT(a): | |
def f(b): | |
return b |
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
import sys | |
import argparse | |
import subprocess | |
parser = argparse.ArgumentParser() | |
parser.add_argument('command', choices=['userpath']) | |
parser.add_argument('--verbose') | |
parser.add_argument('--flag', action='store_true', default=False) |
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
""" | |
http://docs.sqlalchemy.org/en/latest/core/tutorial.html | |
""" | |
import time | |
import logging | |
import logging.config | |
import warnings | |
import sqlparse | |
from functools import partial |
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
cache | |
├── aylien.sqlite | |
├── clavis.sqlite | |
├── google.sqlite | |
├── google_search.sqlite | |
├── joblib | |
│ └── joblib | |
│ └── lib | |
│ └── utils | |
│ └── translate |
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 python | |
import sys | |
from dvc.project import Project | |
from dvc.stage import Stage | |
stage_file = sys.argv[1] | |
dvc = Project() | |
with dvc.state: |
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
import requests | |
from bs4 import BeautifulSoup | |
url = 'https://www.presidency.ucsb.edu/documents/presidential-documents-archive-guidebook/presidential-candidates-debates-1960-2016' | |
response = requests.get(url) | |
soup = BeautifulSoup(response.text, 'html.parser') | |
for tr in soup.select('.field-body > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr'): | |
columns = tr.select('td') | |
if len(columns) == 1: continue |
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
# pip install google-api-python-client | |
from apiclient.discovery import build | |
from httplib2 import Http | |
from oauth2client import file, client, tools | |
SCOPES = 'https://www.googleapis.com/auth/spreadsheets' | |
store = file.Storage('credentials.json') | |
creds = store.get() | |
if not creds or creds.invalid: |