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
    
  
  
    
  | >>> gunicorn_django --bind 0.0.0.0:8000 --name gunicorn_gauge_stage --workers 3 --preload --pid=/tmp/gunicorn_gauge_stage | |
| /home/rob/.virtualenvs/gauge/lib/python2.6/site-packages/S3.py:16: DeprecationWarning: the sha module is deprecated; use the hashlib module instead | |
| import sha | |
| 2011-09-27 02:16:18 [22707] [INFO] Starting gunicorn 0.12.0 | |
| 2011-09-27 02:16:18 [22707] [INFO] Listening at: http://0.0.0.0:8000 (22707) | |
| 2011-09-27 02:16:18 [22708] [INFO] Booting worker with pid: 22708 | |
| 2011-09-27 02:16:18 [22709] [INFO] Booting worker with pid: 22709 | |
| 2011-09-27 02:16:18 [22710] [INFO] Booting worker with pid: 22710 | |
| 2011-09-27 02:16:33 [22707] [INFO] Handling signal: hup | |
| 2011-09-27 02:16:33 [22707] [INFO] Hang up: Master | 
  
    
      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
    
  
  
    
  | #NOTE: .pydistutils.cfg seems to be not compatible with brew install python | |
| #areas I needed to clean before installation | |
| #clean up ~/Library/Python | |
| #clean up .local | |
| brew install python --framework | |
| easy_install pip | |
| pip install virtualenv | |
| pip install virtualenvwrapper | |
| mkdir $HOME/.virtualenvs | 
  
    
      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
    
  
  
    
  | #!/bin/bash | |
| # | |
| # Build a virtual environment suitable for running appengine. | |
| # This uses virtualenvwrapper to make the virtual environment | |
| # and modifies the postactivate/postdeactivate scripts to make | |
| # the appengine code happy. | |
| # | |
| # Usage: | |
| # $ curl -s https://raw.github.com/gist/1282442 | bash | |
| # | 
  
    
      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
    
  
  
    
  | python -c "from lxml import etree; import sys; print(etree.tostring(etree.parse(sys.argv[1], etree.XMLParser(remove_blank_text=True)), pretty_print=True, encoding=unicode))" /path/to/some/xml/file.xml | 
  
    
      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
    
  
  
    
  | #!/usr/bin/env python | |
| import xml.dom.minidom as md | |
| import codecs | |
| import sys | |
| sys.stdout = codecs.getwriter('utf8')(sys.stdout) | |
| pretty_print = lambda f: u'\n'.join([line for line in md.parse(open(f)).toprettyxml(indent=' '*2).split('\n') if line.strip()]) | |
| if __name__ == "__main__": | 
  
    
      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
    
  
  
    
  | def test_image_validation_fails_with_incorrect_filetype(self): | |
| from django.core.files.uploadedfile import SimpleUploadedFile | |
| from StringIO import StringIO | |
| imgfile = StringIO('GIF87a\x01\x00\x01\x00\x80\x01\x00\x00\x00\x00ccc,\x00' | |
| '\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02D\x01\x00;') | |
| test_file = SimpleUploadedFile('TESTFILE', imgfile.read()) | |
| data = {'logo': test_file} | |
| form = self.get_form()({}, data) | |
| self.assertTrue(form.is_valid(), repr(form._errors)) | 
  
    
      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
    
  
  
    
  | > cat base.html | |
| {% block breadcrumb %} | |
| <a href="{% url homepage %}">Home</a> | |
| {% endblock %} | |
| > cat country_detail.html | |
| {% extends "base.html" %} | |
| {% block breadcrumb %} | |
| {{ block.super }} | 
  
    
      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
    
  
  
    
  | notice: /Stage[main]/Apache/File[/etc/apache2/sites-enabled/playdoh.conf]/ensure: defined content as '{md5}f452663cff74e79040145c034b87f224' | |
| notice: /Stage[main]/Apache/Package[libapache2-mod-wsgi]/ensure: ensure changed 'purged' to 'present' | |
| notice: /Stage[main]/Apache/Service[apache2]: Triggered 'refresh' from 2 events | |
| notice: /Stage[main]/Playdoh/Exec[create_mysql_database]/returns: executed successfully | |
| notice: /Stage[main]/Playdoh/Exec[grant_mysql_database]/returns: executed successfully | |
| err: /Stage[main]/Playdoh/Exec[syncdb]/returns: change from notrun to 0 failed: python manage.py syncdb --noinput returned 1 instead of one of [0] at /tmp/vagrant-puppet/manifests/classes/playdoh.pp:27 | |
| notice: /Stage[main]/Playdoh/Exec[migrations]: Dependency Exec[syncdb] has failures: true | 
  
    
      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
    
  
  
    
  | # Based on https://github.com/dcramer/mock-django | |
| import mock | |
| from django.utils.unittest import TestCase | |
| from project.app.models import Category | |
| class ModelMock(mock.MagicMock): | 
  
    
      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
    
  
  
    
  | #! /bin/sh | |
| echo "Purging pyc files and empty directories..." | |
| # Start from the repository root. | |
| cd ./$(git rev-parse --show-cdup) | |
| # Delete .pyc files and empty directories. | |
| find . -name "*.pyc" -delete > /dev/null 2>&1 & | |
| find . -type d -empty -delete > /dev/null 2>&1 & |