Skip to content

Instantly share code, notes, and snippets.

View bsmithyman's full-sized avatar

Brendan Smithyman bsmithyman

View GitHub Profile
@bsmithyman
bsmithyman / resumable.py
Created October 5, 2016 21:44
Generate a resumable upload URL for Google Cloud Storage
import json
import os
from oauth2client.service_account import ServiceAccountCredentials
import httplib2
GCP_CREDENTIALS_FILE = os.getenv('GCP_CREDENTIALS_FILE', 'client-secret.json')
GCS_UPLOAD_URL_PATTERN = 'https://www.googleapis.com/upload/storage'+ \
'/v1/b/{bucket}/o?uploadType=resumable'
def get_upload_url(bucket, filename, content_length, content_type='application/octet-stream'):
@bsmithyman
bsmithyman / keybase.md
Created May 7, 2017 23:30
Verification post for Keybase

Keybase proof

I hereby claim:

  • I am bsmithyman on github.
  • I am bsmithyman (https://keybase.io/bsmithyman) on keybase.
  • I have a public key ASBOa1GAD4sXYNqt3C8cl8KaXBx0A4erRUGsaYDCE_3j0Ao

To claim this, I am signing this object: