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
raph = Raphael([..]); | |
chart = raph.g.linechart([..]); | |
var labels = ["first variable", "second variable", "third variable"]; | |
chart.labels = raph.set(); | |
var x = 15; var h = 5; | |
for( var i = 0; i < labels.length; ++i ) { | |
var clr = chart.lines[i].attr("stroke"); | |
chart.labels.push(raph.set()); | |
chart.labels[i].push(raph.g["disc"](x + 5, h, 5) |
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
### mymodule/filter.py | |
class PageClassFilter(object): | |
def __init__(self, inner_app, classes): | |
self.inner_app = inner_app | |
self.classes = classes | |
def __call__(self, environ, start_response): | |
environ['deliverance.page_classes'] = self.classes | |
return self.inner_app(environ, start_response) | |
def filter_factory(*args, classes): |
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
ejucovy@hotdog:/tmp$ curl -O https://github.com/pypa/virtualenv/raw/master/virtualenv.py | |
ejucovy@hotdog:/tmp$ python virtualenv.py foo | |
New python executable in foo/bin/python | |
Installing setuptools............done. | |
ejucovy@hotdog:/tmp$ cd foo | |
ejucovy@hotdog:/tmp/foo$ ./bin/pip -E /tmp/bar install Tempita | |
The virtual environment does not exist: /tmp/bar | |
and virtualenv is not installed, so a new environment cannot be created | |
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 os, glob | |
import httplib2, lxml.html | |
base = "http://files.turbogears.org/eggs/" | |
http = httplib2.Http() | |
def fetch(url): | |
response, content = http.request(url) | |
Unpacked, decoded diff of ez_setup.py
embedded in virtualenv.py
changed here:
https://github.com/ccnmtl/turbogears_pip_bootstrapper/commit/ef99272697766f3b6cdf4ecfb3f4c4c46a74d227
See http://ccnmtl.columbia.edu/compiled/released/deploying_legacy_turbogears_projects.html and https://github.com/ccnmtl/turbogears_pip_bootstrapper/ for context.
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 random | |
import sys | |
while True: | |
print random.random() | |
sys.stdout.flush() |
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
diff --git a/urls.py b/urls.py | |
index aedc8e4..8a668dc 100644 | |
--- a/urls.py | |
+++ b/urls.py | |
@@ -19,11 +19,11 @@ from commitments import admin as commitments_admin | |
from django.contrib import admin | |
from basic.blog.models import Category, BlogRoll | |
from tagging.models import TaggedItem | |
-admin.site.unregister(Category) | |
-admin.site.unregister(BlogRoll) |
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.contrib.gis.utils import GeoIP | |
def my_view(request): | |
ip_addr = request.META.get("REMOTE_ADDR") | |
assert ip_addr is not None | |
g = GeoIP() | |
lat, lng = g.lat_lon(ip_addr) |
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
date = dateutil.parser.parse("1/1/2012") | |
users = User.objects.filter(actions__created_at__gte=date) | |
users = users.annotate(num_actions=Count('actions')) | |
users = users.filter(num_actions__gte=5) |
OlderNewer