This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> from pinax.apps.projects.models import Project | |
>>> from django.contrib.auth.models import User | |
>>> from pinax.apps.tasks.models import Task | |
>>> t1 = Task.objects.get(pk=1) | |
>>> t2= Task.objects.get(pk=2) | |
>>> t2.get_absolute_url() | |
Traceback (most recent call last): | |
File "<console>", line 1, in <module> | |
File "/home/issackelly/envs/new/lib/python2.6/site-packages/django/utils/functional.py", line 55, in _curried | |
return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
timeEvents = Object() | |
timeEvents["#somevid"]["125"] = function(){ $("#somediv").show() } | |
function timeListener(el) { | |
$(el).bind('timeupdate', function(){ | |
time = this.currentTime; | |
if timeEvents[el][time] | |
timeEvents[el][time]() | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pprint | |
class SqlDumpMiddleware(object): | |
def process_response(self, request, response): | |
from django.db import connection | |
pp = pprint.PrettyPrinter(indent=4) | |
pp.pprint(connection.queries) | |
return response |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ brew install pyqt | |
Warning: It appears you have MacPorts or Fink installed. | |
Software installed with MacPorts and Fink are known to cause problems. | |
If you experience issues try uninstalling these tools. | |
==> Downloading http://www.riverbankcomputing.co.uk/hg/sip/archive/4.11.2.tar.gz | |
######################################################################## 100.0% | |
==> Downloading patches | |
==> Patching | |
patching file build.py | |
patching file siputils.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% load biblion_tags %} <!-- at the top of the page --> | |
{% latest_blog_posts as posts %}<!-- gets 5 posts --> | |
{% for post in posts %} | |
{% if forloop.first %} | |
<h1><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h1> | |
{{ post.content_html|truncatewords_html:30 }} | |
{% else %} | |
<h3><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h3> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""/doc <something>: return python 2.7's documentation for <something>""" | |
import re | |
import importlib | |
import pydoc | |
from chatbot import send, p | |
#by default, render_doc uses shell escapes. Stop that. | |
class PlainTextDoc(pydoc.TextDoc): | |
def bold(self, x): return x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
import django.core.exceptions | |
from django.http import HttpResponsePermanentRedirect | |
from django.utils import translation | |
# TODO importing undocumented function | |
from django.utils.translation.trans_real import parse_accept_lang_header | |
from localeurl import settings as localeurl_settings | |
from localeurl import utils | |
# Make sure the default language is in the list of supported languages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Template: A.html | |
<html> | |
<head></head> | |
<body> | |
{% block hello %} | |
HELLO | |
{% endblock %} | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.. Proposal submission template for PyOhio 2011 | |
.. Columbus, OH July 30 - 31, 2011 | |
.. Information at http://pyohio.org or [email protected] | |
.. Submit by June 7, 2011 to [email protected] | |
.. Template uses reStructuredText format: http://docutils.sourceforge.net/rst.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var _gaq = _gaq || []; | |
_gaq.push(['_setAccount', 'UA-22349542-1']); | |
_gaq.push(['_trackPageview']); | |
var pageTracker; | |
(function() { | |
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; | |
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
OlderNewer