Skip to content

Instantly share code, notes, and snippets.

View chrislkeller's full-sized avatar

Chris Keller chrislkeller

View GitHub Profile
@shaneshifflett
shaneshifflett / maplegend.js
Last active October 6, 2015 14:18
Generate a legend for a map... updated to not require jquery
function MapLegendView(el, values, headerText, footerText){
/*
Class to dynamically generate a legend for a given map
el: containing element
values: array of key, value objects
ex: var legendItems = [
{text: 'text to display next to color', colorStr: 'color of legend item (hex preferred)'},
]
you'll want your container element and map to be contained in the same parent element
and to position the containing element to float over the map like so:
@fcurella
fcurella / django_postgis_on_os_x.md
Created July 27, 2012 15:22
Django and Postgis on OS X

Django and Postgis on OS X

Install Homebrew

Install a few things with homebrew:

Notice that some packages give you information at the end, read it carefully. To recall that info use brew info like this: $ brew info postgresql

$ brew install python --universal
@mindlace
mindlace / middleware.py
Created October 19, 2012 13:43
Add user created/modified to every model
"""Add user created_by and modified_by foreign key refs to any model automatically.
Almost entirely taken from https://github.com/Atomidata/django-audit-log/blob/master/audit_log/middleware.py"""
from django.db.models import signals
from django.utils.functional import curry
class WhodidMiddleware(object):
def process_request(self, request):
if not request.method in ('GET', 'HEAD', 'OPTIONS', 'TRACE'):
if hasattr(request, 'user') and request.user.is_authenticated():
user = request.user
@max-mapper
max-mapper / readme.md
Last active October 12, 2015 10:17
introduction to node
@palewire
palewire / crayola.mss
Created December 20, 2012 21:18
The 133 standard Crayola crayon colors in CartosCSS and ready for use with TileMill.
/*
Crayola crayon colors
Compiled by @LATdatadesk
Source: http://en.wikipedia.org/wiki/List_of_Crayola_crayon_colors
*/
// Standard colors
@almond: #EFDECD;
@antique_brass: #CD9575;
@shaneshifflett
shaneshifflett / downloader.py
Created January 8, 2013 19:13
download files from a list of URLs
import requests
scraper_urls = [
'http://foo.net/TESTDIR/TEST.pdf',
'http://foo.net/TESTDIR/TEST2.pdf'
]
p_session = requests.session()
for surl in scraper_urls:
content = p_session.get(surl).content
@rdmurphy
rdmurphy / index.html
Last active December 11, 2015 07:48
How I use HTML5 geolocation in my apps.
<span class="geoFind" id="geoFind">Just find me!</span>
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 1, 2025 01:48
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@ramesaliyev
ramesaliyev / backboneHandlebarsDynamicRender.html
Last active November 3, 2020 00:52 — forked from kyleondata/gist:3440492
Backbone-Handlebars Dynamic Render
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="jquery-1.9.0.js" ></script>
<script src="handlebars-1.0.rc.2.js" ></script>
<script src="underscore-1.4.4.js" ></script>
<script src="backbone-0.9.10.js" ></script>
@stucka
stucka / gist:5342652
Last active October 16, 2018 09:05
Tabula installation instructions for Ubuntu 12.04. Tabula turns PDFs into CSVs! http://source.mozillaopennews.org/en-US/articles/introducing-tabula/
Yeah, this all got outmoded when serious dependency problems with Tabula were removed.
No need to use this. Get Tabula directly. http://tabula.nerdpower.org/