Skip to content

Instantly share code, notes, and snippets.

@kcranston
kcranston / device-flow.py
Last active Nov 11, 2020
GitHub Device Flow
View device-flow.py
import requests
client_id = "Iv1.8df72ad9560c774c"
header = {"Content-Type": "application/json", "Accept": "application/json"}
# Step 1
payload1 = {"client_id": client_id,}
r = requests.post(
'https://github.com/login/device/code',headers=header,json=payload1
)
View keybase.md

Keybase proof

I hereby claim:

  • I am kcranston on github.
  • I am kcranstn (https://keybase.io/kcranstn) on keybase.
  • I have a public key ASDToFvPm9f1d3BK6NvfUVaE5Yzd2JKNpf9Q4IIA_nDFnwo

To claim this, I am signing this object:

View Bioinformatics_pandas_demo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kcranston
kcranston / postgres-jsonb.md
Last active Mar 23, 2018
intro to document stores in postgreSQL
View postgres-jsonb.md

Document stores in PostgreSQL

Notes for software engineering meeting presentation

What

  • mid to late 2000s: appearance of Document stores / NoSQL databases such as Mongo, Couch
  • Relational DBs now have support for document data: JSON in MySQL, JSON and JSONB in PostgreSQL
  • Focus on JSONB in Postgres (most full featured)
@kcranston
kcranston / output_ott_to_csv.py
Last active Aug 19, 2016
Diagnosting encoding issues with OTT
View output_ott_to_csv.py
import codecs
import csv
import peyotl.ott as ott
ott_loc = "path-to-ott"
taxonomy = ott.OTT(ott_loc)
ott_names = taxonomy.ott_id_to_names
ott_parents = taxonomy.ott_id2par_ott_id
ott_filename = "ott.csv"