Skip to content

Instantly share code, notes, and snippets.

View eyeseast's full-sized avatar

Chris Amico eyeseast

View GitHub Profile
@eyeseast
eyeseast / gist:1105393
Created July 25, 2011 22:23
Query Google Fusion Tables with jQuery
function query(sql, callback) {
var base = "https://www.google.com/fusiontables/api/query?";
var url = base + $.param({sql: sql});
$.ajax({
url: url,
dataType: 'jsonp',
jsonp: 'jsonCallback',
success: callback
});
};
@eyeseast
eyeseast / color.js
Created August 23, 2011 14:23
Colors, light to dark
var COLORS = {
red: [
"ECA496",
"E27560",
"D9482B",
"A33622",
"6D2516"
],
green: [
"8BC0BF",
@eyeseast
eyeseast / httplib2-auth.py
Created September 3, 2011 15:06
Demo of basic auth under httplib2
#!/usr/bin/env python
import httplib2
from pprint import pprint
URL = "https://httpbin.ep.io/basic-auth/user/pass"
USER = "user"
PASSWORD = "pass"
http = httplib2.Http('.cache')
#!/usr/bin/env python
import httplib2
import json
from pprint import pprint
URL = "http://www.documentcloud.org/api/search"
http = httplib2.Http('.cache')
def latest_docs(url):
jQuery(function($) {
$('#map_canvas').css({
height: "400",
width: "620"
});
window.ft_map = new google.maps.Map(document.getElementById('map_canvas'), {
center: new google.maps.LatLng(27.858504,-81.101074),
zoom: 6,
line-color: @countyborder;
line-width: .5;
line-join: round;
// scale
polygon-fill: @scale1;
[CHG_OwnerO > -0.1] {
polygon-fill: @scale2;
}
#lakes[ScaleRank < 4] {
line-color: @border;
polygon-fill: @water;
}
@eyeseast
eyeseast / known-problems.md
Created November 4, 2011 16:12
Building a better editing workspace

Known problems:

  • autosave
  • clutter (things that get in the way of writing)
  • handling taxonomies (tag input, category overload, nesting)
  • rich text and presentation (what WYSIWYG editors try to solve)
  • media (photos, slide shows, documents, audio, maps, etc)
@eyeseast
eyeseast / states.html
Created December 20, 2011 15:23
For those times you need a state <select>
<option value="">State</option>
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
<option value="DC">District of Columbia</option>
@eyeseast
eyeseast / gist:1519647
Created December 25, 2011 19:37
Christmas afternoon on a new laptop...
Successfully installed django django-celery django-debug-toolbar django-filebrowser django-flatblocks django-grappelli django-haystack django-memcache-status django-model-utils django-redis-cache django-smuggler django-tastypie BeautifulSoup docutils fabric feedparser geopy johnny-cache kombu mimeparse PIL psycopg2 pysolr python-memcached redis sorl-thumbnail south typogrify python-dateutil python-wordpress boto django-storages python-nameparser django-boundaryservice django-disqus django-picklefield celery python-digest ssh anyjson amqplib smartypants pycrypto
Cleaning up...