Skip to content

Instantly share code, notes, and snippets.

View medmunds's full-sized avatar

Mike Edmunds medmunds

  • Planapple
  • San Francisco, CA, USA
  • 08:34 (UTC -07:00)
View GitHub Profile
@medmunds
medmunds / mail.py
Created January 15, 2015 22:13
queue_message for use with django-mailer
# queue_message(message, priority="medium")
# Queues an EmailMessage object, in apps using django-mailer.
# (https://github.com/pinax/django-mailer)
# Respects django-mailer's DontSendEntry blacklist.
# If django-mailer is not loaded, just sends the message immediately.
from django.conf import settings
if "mailer" in settings.INSTALLED_APPS:
# Sigh. Django-mailer doesn't expose its queuing API in a useful way, so we replicate parts of it here.
@medmunds
medmunds / knockout-jquery-ui-widget.js
Created March 27, 2011 17:35
Knockout binding for jQuery.ui.widget
// knockout-jquery-ui-widget.js
// Copyright (c) 2011, Planapple, Inc.
// License: MIT (http://www.opensource.org/licenses/mit-license.php)
//
// Knockout binding for jQuery UI widgets
//
// Examples:
// <input type="submit" value="OK" data-bind='jqueryui: "button"' />
//
// Attaches a jQuery UI button widget to this button, with default options.