Skip to content

Instantly share code, notes, and snippets.

View jsykora's full-sized avatar

John Sykora jsykora

  • Lake Geneva, Wisconsin
View GitHub Profile

DON'T BE A DICK PUBLIC LICENSE

Version 1, December 2009

Copyright (C) 2009 Philip Sturgeon [email protected]

Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.

@mkelley33
mkelley33 / contact-us-fields.html
Created September 3, 2011 03:31
django 1.3 ajax contact form post using jQuery
<!-- this will be requested and rendered via ajax so we only want the form fields
so we can replace them later using jQuery with the fields PLUS the errors. -->
<div id="form-fields">
{{ form.as_p }}
</div>
@mhulse
mhulse / helpers.py
Created June 15, 2011 19:34
Django (1.3) Google Maps v3 Geocoder service lookup example
import urllib, urllib2, simplejson
from django.utils.encoding import smart_str
def get_lat_lng(location):
# http://djangosnippets.org/snippets/293/
# http://code.google.com/p/gmaps-samples/source/browse/trunk/geocoder/python/SimpleParser.py?r=2476
# http://stackoverflow.com/questions/2846321/best-and-simple-way-to-handle-json-in-django
# http://djangosnippets.org/snippets/2399/
@lukeman
lukeman / gist:386835
Created May 2, 2010 02:14
Example of using django-sorting, django-filter and django-pagination together
{% load pagination_tags %}
{% load sorting_tags %}
{% block body %}
{% autosort filter.qs as sorted_objects %}
{% autopaginate sorted_objects 10 as object_list %}
{% for object in object_list %}
{{ object }}
@danmackinlay
danmackinlay / supervisord.sh
Created August 27, 2009 07:07
an init.d script for supervisord
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.