Skip to content

Instantly share code, notes, and snippets.

View pamelafox's full-sized avatar

Pamela Fox pamelafox

View GitHub Profile
@pamelafox
pamelafox / mobilelogpage.js
Created March 25, 2012 06:28
MobileLogPage
MobileLogPage.prototype = MobilePage.prototype;
MobileLogPage.prototype.getForm = function() {
return ED.shared.logForms[this.id];
};
MobileLogPage.prototype.getErrorDOM = function() {
return $('#mobile-' + this.id + '-page .log-error');
};
@pamelafox
pamelafox / touch.js
Created March 26, 2012 17:31
Touch Events
dom.each(function() {
$(this).unbind('tap', callback);
$(this).bind('tap', callback);
$(this).bind('touchstart', function(e) {
e.preventDefault();
var item = e.currentTarget;
if (ISTOUCHING) return;
item.moved = false;
@pamelafox
pamelafox / geonames.py
Created April 3, 2012 00:22
Geonames Python wrapper
import sys
import urllib
import urllib2
import json
import logging
class GeonamesError(Exception):
def __init__(self, status):
@pamelafox
pamelafox / queue.yaml
Created April 6, 2012 21:48
Geocoding with named task queue parameters on App Engine
queue:
- name: geocoding
rate: 1/m
retry_parameters:
task_retry_limit: 60
task_age_limit: 3d
min_backoff_seconds: 120
@pamelafox
pamelafox / README.md
Created April 9, 2012 20:49
Instagram Python API Reference

python-instagram

A Python client for the Instagram REST and Search APIs

Installation

pip install python-instagram

Requires

@pamelafox
pamelafox / tumlbr_template.html
Created April 12, 2012 19:07
Twitter Bootstrap Tumblr Theme
<!doctype html>
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en" xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name='description' content='{MetaDescription}'>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@pamelafox
pamelafox / util.js
Created April 13, 2012 17:44
JavaScript Utility Libraries (Scroll down!)
var ED = ED || {};
// Utility functions
ED.util = (function() {
// Data structure functions
function each(object, callback) {
if (object === null) return;
@pamelafox
pamelafox / impl_example.js
Created April 13, 2012 19:08
impl example
function MobilePage() {
this.initialized = false;
}
MobilePage.prototype.setup = function() {};
MobilePage.prototype.setupOnce = function() {
if (this.initialized !== true) this.setup();
this.initialized = true;
};
@pamelafox
pamelafox / zepto.js
Created April 17, 2012 05:04
Zepto Port (Bootstrap-friendly, Plugin-friendly, etc)
// Zepto.js
// (c) 2010, 2011 Thomas Fuchs
// Zepto.js may be freely distributed under the MIT license.
(function(undefined){
if (String.prototype.trim === undefined) // fix for iOS 3.2
String.prototype.trim = function(){ return this.replace(/^\s+/, '').replace(/\s+$/, '') };
// For iOS 3.x
// from https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/reduce
@pamelafox
pamelafox / mobile_photo.js
Created April 19, 2012 02:49
Getting/rotating photos in PhoneGap
function getPhoto(mealId, sourceType, saveOnSuccess) {
var $mealDiv = $('#log-meal-' + mealId);
var $mealImg = $mealDiv.find('.log-meal-photo-button img');
var $quickpicStatus = $('#mobile-quickpic-link span');
function resetQuickPicStatus() {
$quickpicStatus.html('').addClass('icon-camera');
}