Skip to content

Instantly share code, notes, and snippets.

James Turk jamesturk

Block or report user

Report or block jamesturk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View make_all_public.py
import boto3
client = boto3.client('s3')
s3 = boto3.resource('s3')
paginator = client.get_paginator('list_objects')
count = 0
for page in paginator.paginate(Bucket='data.example', Prefix='images', MaxKeys=10000):
for key in page['Contents']:
object_acl = s3.ObjectAcl('data.example', key['Key'])
@jamesturk
jamesturk / postgres_bulk.py
Created Dec 5, 2018
bulk loading from postgres
View postgres_bulk.py
import csv
from io import StringIO
from django.db import connection
def postgres_bulk_copy(objects, ModelCls=None,
table_name=None,
fields=None, not_null=None, null=None,
include_id=False,
):
@jamesturk
jamesturk / person.yaml
Created Sep 24, 2018
mapping OCD people to YAML
View person.yaml
full_name:
sort_name:
family_name/last_name:
given_name/first_name:
gender:
summary:
biography:
birth_date:
death_date:
@jamesturk
jamesturk / django1.9.rst
Last active Dec 15, 2015
django 1.9 notes
View django1.9.rst

Django 1.9

RC1 released November 16th

contrib.postgres (round 2)

JSONField

View keybase.md

Keybase proof

I hereby claim:

  • I am jamesturk on github.
  • I am jpt (https://keybase.io/jpt) on keybase.
  • I have a public key whose fingerprint is D9C8 FDB1 DB86 DAC9 0806 C573 0FB3 3E39 5D3B E8A6

To claim this, I am signing this object:

You can’t perform that action at this time.