Skip to content

Instantly share code, notes, and snippets.

View scardine's full-sized avatar

Paulo Scardine scardine

View GitHub Profile
@egor83
egor83 / Google_Spreadsheets.py
Last active September 14, 2016 21:01
Working with Google spreadsheets with Python GData API
client = gdata.spreadsheets.client.SpreadsheetsClient()
token.authorize(client)
sps = client.GetSpreadsheets()
print len(sps.entry) # shows how many spreadsheets you have
sprd_key = 'put an appropriate spreadsheet key here'
wss = client.GetWorksheets(sprd_key) # get a list of all worksheets in this spreadsheet, to look around for info in a debugger
ws = client.GetWorksheet(sprd_key, 'od6') # get the first worksheet in a spreadsheet; seems 'od6' is always used as a WS ID of the first worksheet
@ivanvanderbyl
ivanvanderbyl / gist:4222308
Created December 6, 2012 06:55
Postgres 9.1 to 9.2 upgrade guide for Ubuntu 12.04
sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update
sudo apt-get install postgresql-9.2 postgresql-server-dev-9.2 postgresql-contrib-9.2
sudo su -l postgres
psql -d template1 -p 5433
CREATE EXTENSION IF NOT EXISTS hstore;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
service postgresql stop
/usr/lib/postgresql/9.2/bin/pg_upgrade -b /usr/lib/postgresql/9.1/bin -B /usr/lib/postgresql/9.2/bin -d /var/lib/postgresql/9.1/main/ -D /var/lib/postgresql/9.2/main/ -O "-c config_file=/etc/postgresql/9.2/main/postgresql.conf" -o "-c config_file=/etc/postgresql/9.1/main/postgresql.conf"
@paulsmith
paulsmith / verbatim_templatetag.py
Created October 25, 2011 19:03 — forked from ericflo/verbatim_templatetag.py
verbatim Django template tag
"""
jQuery templates use constructs like:
{{if condition}} print something{{/if}}
This, of course, completely screws up Django templates,
because Django thinks {{ and }} mean something.
Wrap {% verbatim %} and {% endverbatim %} around those
blocks of jQuery templates and this will try its best