This file contains 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
def _mysql_storage_engine(self): | |
''' | |
birkin, 2012-08: | |
- working around failure on SHOW TABLE STATUS WHERE Name='INTROSPECT_TEST' | |
- env/lib/python2.7/site-packages/django/db/backends/mysql/base.py | |
- pip freeze yields Django==1.4.1 & MySQL-python==1.2.3, & mysql is v 4.1.22 | |
''' | |
"Internal method used in Django tests. Don't rely on this from your code" | |
if self._storage_engine is None: | |
cursor = self.connection.cursor() |
This file contains 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 Queue, threading, urllib2 | |
from datetime import datetime | |
'''queue syntax assumes python 2.5 or greater''' | |
CHARACTERS = 50 | |
timer_list = [] | |
class ThreadUrl(threading.Thread): |
This file contains 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
# -*- coding: utf-8 -*- | |
import json, logging | |
log = logging.getLogger(__name__) | |
class LoginManager( object ): | |
''' |
This file contains 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
#!/bin/sh | |
## shell script for easily updating django app code | |
## usage, `bash ./this.sh` | |
## setup | |
ACTIVATE_FILE="" | |
GROUP="" | |
LOG_DIR_PATH="" |
This file contains 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
def search_custom( request, collection ): | |
""" | |
Returns unmodified SELECT solr requests to settings_app.COLLECTION_MAPPER solr urls. | |
# possible TODO: override max_rows | |
""" | |
## check that we're only using GET requests | |
if request.method != 'GET': | |
return HttpResponseNotAllowed(['GET']) | |
## grab request parameter string | |
logger.debug( u'request.GET: %s' % request.GET ) |
This file contains 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
# comments... | |
# - project_httpd.conf was often part of django_project_dir -> project_dir -> apache_dir | |
# now I call my wsgi file from a server .conf included into the main httpd.conf file | |
# - env is often sibling of project directory | |
# wsgi.py is usually part of django_project_dir -> project_dir -> apache_dir | |
*.pyc | |
*httpd.conf | |
.DS_Store | |
.hg |
This file contains 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
# Ignore everything | |
* | |
# But not these files... | |
!.gitignore | |
!__init__.py | |
!manage.py | |
!READ_ME.txt |
This file contains 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
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Request json test</title> | |
<script src="http://code.jquery.com/jquery-1.5.js"></script> | |
<script type="text/javascript"> | |
$.get( | |
"http://library.brown.edu/projects/usep/inscription/CA.Berk.UC.HMA.G.8-3898/?format=json", // url, {"q":"some-query"}, data | |
function(data){ | |
var data_div = $('div#showdata').html( data.writing ); |
This file contains 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
Show hidden characters
{ | |
"settings": { | |
"translate_tabs_to_spaces": false | |
}, | |
"folders": | |
[ | |
{ | |
"path": "/path/to/dir/projectx" | |
}, | |
{ |
This file contains 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
# -*- coding: utf-8 -*- | |
""" Shows how to call the kakadu library with envoy. | |
In particular, shows how to handle paths containing spaces. | |
Updated to show how to handle apostrophe in source path. | |
- kakadu is a jpeg2000 library | |
- envoy is a wrapper around the subprocess module | |
- kakadu: http://en.wikipedia.org/wiki/Kakadu_(software) | |
- envoy: https://github.com/kennethreitz/envoy | |
""" |
OlderNewer