Skip to content

Instantly share code, notes, and snippets.

View jdunck's full-sized avatar

Jeremy Dunck jdunck

View GitHub Profile
@bretthoerner
bretthoerner / client
Created July 27, 2011 19:25
Scribe configuration
port=1464
<store>
category=default
type=buffer
max_write_interval=1 # process messages at least once per second
<primary>
type=network
@dehora
dehora / build-scribe-2.2.tar.gz.rst
Created July 7, 2011 20:17
build-scribe-2.2.tar.gz

Did this to build scribe-2.2.tar.gz

Get thrift 0.5.0 instead of 0.6.1/0:

sudo apt-get install php5-dev
sudo apt-get install php-config # *-php=no didn't quite work out for me
sudo ./configure --with-haskell=no  # with-haskell=for-great-good did NOT work

and then configure/make/install thrift and fb303

@onyxfish
onyxfish / test_cache.py
Created June 28, 2011 21:30
Python unittest-based cache testing rig for Varnish + Wordperss
#!/usr/bin/env python
import cookielib
import json
import re
import random
import unittest
import requests
from wordpress_xmlrpc import Client, WordPressComment, WordPressPost
"""
Patches the database wrapper and template engine to throw an exception if a query is executed inside of a template.
In your urls.py, enable it like so:
>>> import monkey
>>> monkey.patch_templates()
"""
import logging
@dgouldin
dgouldin / noparse.py
Created October 19, 2010 16:43
Django template block tag {% noparse %} renders template syntax characters within the block as normal text.
from django import template
register = template.Library()
token_formats = {
template.TOKEN_TEXT: '%s',
template.TOKEN_VAR: '%s%%s%s' % (template.VARIABLE_TAG_START, template.VARIABLE_TAG_END),
template.TOKEN_BLOCK: '%s%%s%s' % (template.BLOCK_TAG_START, template.BLOCK_TAG_END),
template.TOKEN_COMMENT: '%s%%s%s' % (template.COMMENT_TAG_START, template.COMMENT_TAG_END),
}
"""
jQuery templates use constructs like:
{{if condition}} print something{{/if}}
This, of course, completely screws up Django templates,
because Django thinks {{ and }} mean something.
Wrap {% verbatim %} and {% endverbatim %} around those
blocks of jQuery templates and this will try its best