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
| require 'githop' | |
| require 'sinatra' | |
| def githop_html(user) | |
| config = { | |
| 'bigquery' => { | |
| 'client_id' => ENV['BIGQUERY_CLIENT_ID'], | |
| 'service_email' => ENV['BIGQUERY_SERVICE_EMAIL'], | |
| 'keyfile' => ENV['BIGQUERY_KEYFILE'], | |
| 'project_id' => ENV['BIGQUERY_PROJECT_ID'] |
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 | |
| # Backs up the OpenShift PostgreSQL database for this application | |
| # by Skye Book <[email protected]> | |
| NOW="$(date +"%Y-%m-%d")" | |
| FILENAME="$OPENSHIFT_DATA_DIR/$OPENSHIFT_APP_NAME.$NOW.backup.sql.gz" | |
| pg_dump $OPENSHIFT_APP_NAME | gzip > $FILENAME |
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
| # Dynamically load virtualenvwrapper functions to reduce shell startup | |
| # time. | |
| # | |
| # Copyright 2012 Aron Griffis <[email protected]> | |
| # Released under the GNU GPL v3 | |
| ####################################################################### | |
| # Python virtualenvwrapper loads really slowly, so load it on demand. | |
| if [[ $(type -t workon) != function ]]; then | |
| virtualenv_funcs=( workon deactivate mkvirtualenv ) |
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.core.exceptions import MiddlewareNotUsed | |
| from django.conf import settings | |
| import cProfile | |
| import pstats | |
| import marshal | |
| from cStringIO import StringIO | |
| class ProfileMiddleware(object): | |
| def __init__(self): | |
| if not settings.DEBUG: |
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 | |
| # -*- coding: utf-8 -*- | |
| import urllib2 | |
| gh_url = 'https://api.github.com' | |
| req = urllib2.Request(gh_url) | |
| password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm() |