Skip to content

Instantly share code, notes, and snippets.

Pamela Fox pamelafox

Block or report user

Report or block pamelafox

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
@pamelafox
pamelafox / showspreadsheet.php
Created Jan 8, 2011
PHP for parsing the JSON output a published Google spreadsheet and displaying columns from each row.
View showspreadsheet.php
<?php
// Parsing this spreadsheet: https://spreadsheets.google.com/pub?key=0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc&hl=en&output=html
$url = 'http://spreadsheets.google.com/feeds/list/0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc/od6/public/values?alt=json';
$file= file_get_contents($url);
$json = json_decode($file);
$rows = $json->{'feed'}->{'entry'};
foreach($rows as $row) {
echo '<p>';
View Completely Static App
application: oliverfoxmurals
version: 1
runtime: python
api_version: 1
handlers:
- url: /
static_files: static/index.html
upload: static/index.html
@pamelafox
pamelafox / Makefile
Created Apr 25, 2011
JS/CSS Compressor Makefile
View Makefile
# Javascript/CSS Compressor Makefile
# Original by Benjamin "balupton" Lupton (MIT Licenced)
# Modified by Pamela Fox
MAKEFLAGS = --no-print-directory --always-make
MAKE = make $(MAKEFLAGS)
BUILDDIR = ./.build
CLOSUREURL = http://closure-compiler.googlecode.com/files/compiler-latest.zip
@pamelafox
pamelafox / googl.py
Created Apr 29, 2011
Shortening URLS using goo.gl
View googl.py
import cgi
import urllib, urllib2
import logging
from django.utils import simplejson
class Googl():
def __init__(self, api_key):
self.api_key = api_key
self.base_url = 'https://www.googleapis.com/urlshortener/v1/url?key=%s' % self.api_key
@pamelafox
pamelafox / countryinfo.py
Created May 23, 2011
Python list of country codes, names, continents, capitals, and pytz timezones
View countryinfo.py
countries = [
{'timezones': ['Europe/Andorra'], 'code': 'AD', 'continent': 'Europe', 'name': 'Andorra', 'capital': 'Andorra la Vella'},
{'timezones': ['Asia/Kabul'], 'code': 'AF', 'continent': 'Asia', 'name': 'Afghanistan', 'capital': 'Kabul'},
{'timezones': ['America/Antigua'], 'code': 'AG', 'continent': 'North America', 'name': 'Antigua and Barbuda', 'capital': "St. John's"},
{'timezones': ['Europe/Tirane'], 'code': 'AL', 'continent': 'Europe', 'name': 'Albania', 'capital': 'Tirana'},
{'timezones': ['Asia/Yerevan'], 'code': 'AM', 'continent': 'Asia', 'name': 'Armenia', 'capital': 'Yerevan'},
{'timezones': ['Africa/Luanda'], 'code': 'AO', 'continent': 'Africa', 'name': 'Angola', 'capital': 'Luanda'},
{'timezones': ['America/Argentina/Buenos_Aires', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/Tucuman', 'America/Argentina/Catamarca', 'America/Argentina/La_Rioja', 'America/Argentina/San_Juan', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Ushuai
@pamelafox
pamelafox / newtalk.html
Created May 23, 2011
Calculating timezone from city/country
View newtalk.html
<!DOCTYPE html>
<html">
<head>
<script src="/static/js/jquery.min.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
</head>
<body>
<h2 class="headline">New Talk</h2>
@pamelafox
pamelafox / underscore + autocomplete
Created May 23, 2011
Finding component in maps api geocoder result
View underscore + autocomplete
function findComponent(result, type) {
for (var i = 0; i , result.address_components.length; i++) {
var component = result.address_components[i];
for (var j = 0; j < component.types.length; j++) {
if (component.types[j] == type) {
return component.short_name;
}
}
}
}
@pamelafox
pamelafox / friendsearch.html
Created Jun 2, 2011
Facebook API + jQuery Autosuggest
View friendsearch.html
<!doctype html>
<head>
<link rel="stylesheet" href="/css/style.css">
<body>
<input class="friend-search"></input>
<div id="fb-root"></div>
<script>window.jQuery || document.write("<script src='/js/libs/jquery-1.5.1.min.js'>\x3C/script>")</script>
<script src="/js/jquery.autosuggest.js"></script>
@pamelafox
pamelafox / gist:1006753
Created Jun 3, 2011
Sendgrid Python Web API example
View gist:1006753
import urllib2, urllib
import logging
def send_mail_sendgrid(from, to, subject, body):
base_url = 'https://sendgrid.com/api/mail.send.json'
params = {
'api_user': 'you@you.com',
'api_key': 'yourpassword',
'from': from,
'to': to,
@pamelafox
pamelafox / jsonp.js
Created Jun 15, 2011
jsonp + lscache
View jsonp.js
//Lightweight JSONP fetcher - www.nonobtrusive.com
var JSONP = (function(){
var counter = 0, head, query, key, window = this;
function load(url) {
var script = document.createElement('script'),
done = false;
script.src = url;
script.async = true;
script.onload = script.onreadystatechange = function() {
You can’t perform that action at this time.