Skip to content

Instantly share code, notes, and snippets.

@ratpik
ratpik / HTTP Post Android to Django Tastypie
Created March 24, 2013 17:36
This describes a way to submit HTTP POST in a way the REST interface provided by Tastypie to Django understands it for JSON data
//Creating the data to be sent, note the escaped quotes that are required
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(3);
nameValuePairs.add(new BasicNameValuePair("\A\"", "\"/api/v1/a/1/\""));
nameValuePairs.add(new BasicNameValuePair("\"B\"", "\"/api/v1/b/1/\""));
nameValuePairs.add(new BasicNameValuePair("\"C\"", "\"Hello from Android\""));
@philipn
philipn / gist:1138957
Created August 11, 2011 05:25
GeoTIFF metadata / ftp download
"""
This likely isn't useful to anybody else. But it's an example of how to
adapt python's ftplib to grab just the first few kb of a given file.
In this case, all we need is the first few kb to get the metadata from a
GeoTIFF file.
"""
import ftplib