Skip to content

Instantly share code, notes, and snippets.

@kcranston
kcranston / output_ott_to_csv.py
Last active August 19, 2016 18:04
Diagnosting encoding issues with OTT
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"
@kcranston
kcranston / postgres-jsonb.md
Last active November 14, 2024 23:33
intro to document stores in postgreSQL

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)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kcranston
kcranston / keybase.md
Created April 1, 2019 14:07
keybase proof

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:

@kcranston
kcranston / device-flow.py
Last active April 1, 2022 08:55
GitHub Device Flow
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
)