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
| description "uWSGI server for electris CMS" | |
| start on runlevel [2345] # start on all runlevels. | |
| stop on runlevel [!2345] # stop when shutting down. | |
| respawn # respawn if job crashes or is stopped ungracefully. | |
| env DEPLOYMENT_TARGET=production # set any environment variables you like here. | |
| env DJANGO_SETTINGS_FILE=conf/settings.py # more environment variables if you like. | |
| env PYTHONPATH=/home/ubuntu/apps/my_app:/home/ubuntu/.virtualenv/my_app |
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
| try: | |
| import xlrd | |
| def XLSDictReader(f, sheet_index=0): | |
| data = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) | |
| book = xlrd.open_workbook(file_contents=data) | |
| sheet = book.sheet_by_index(sheet_index) | |
| def item(i, j): | |
| return (sheet.cell_value(0,j), sheet.cell_value(i,j)) |
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
| find ./ -name "*.py" -exec gsed -r -i '1,1s/^/"""\n:copyright: (c) 2014 Building Energy Inc\n:license: Apache v2, see LICENSE for more details.\n"""\n/' {} \; |
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 | |
| # Just copy and paste the lines below (all at once, it won't work line by line!) | |
| # MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY! | |
| function abort { | |
| echo "$1" | |
| exit 1 | |
| } | |
| set -e |
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 requests | |
| def do_session_get(): | |
| session = requests.session() | |
| return session.get('foo') |
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 | |
| # encoding: utf-8 | |
| """ | |
| Invalidate Johnny Cache's cache for given models outside "normal Django" | |
| (e.g. in a management command). | |
| """ | |
| from johnny.cache import invalidate | |
| from johnny.middleware import QueryCacheMiddleware |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Chernoff Smileys</title> | |
| <script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.5.0"></script> | |
| <script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.5.0"></script> | |
| <style type="text/css"> | |
| </style> | |
| </head> |
NewerOlder