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
$httpProvider.responseInterceptors.push(function ($q, LoadingManager) { | |
return function (promise) { | |
LoadingManager.startLoading(); | |
return promise.then(function (response) { | |
LoadingManager.stopLoading(); | |
return response; | |
}, function (response) { | |
LoadingManager.stopLoading(); | |
return $q.reject(response); | |
}); |
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
define([], function() { | |
'use strict'; | |
return function ($scope, $http, $routeParams, $q, $location) { | |
var warehouseId = $routeParams.warehouseId, | |
warehouseDeferred = $q.defer(), | |
locationsDeferred = $q.defer(); | |
// @TODO: Resolve these. | |
$scope.crumbs = []; | |
$scope.warehouse = warehouseDeferred.promise; | |
$scope.locations = locationsDeferred.promise; |
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
// ... | |
// ... | |
app.config(function($routeProvider, $locationProvider) { | |
$locationProvider.html5Mode(true); | |
// ... | |
$routeProvider.otherwise({ | |
redirectTo: function (params, path, search) { | |
search = jquery.param(search); | |
if (search) { | |
window.location = path + '?' + search; |
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 redirect_if_not_logged_in(request): | |
if request.user is None: | |
request.session['original_url'] = request.url | |
return HTTPFound(location=request.route_url( | |
request.registry.settings['auth.login_route_name'])) | |
return Forbidden() | |
def main(global_config, **settings): | |
#... |
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 sqlalchemy.ext.declarative import declarative_base | |
import sqlalchemy as db | |
from sqlalchemy.orm import relationship | |
from sqlalchemy import create_engine | |
from sqlalchemy.orm import scoped_session, sessionmaker | |
from datetime import datetime | |
Base = declarative_base() | |
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 set_request_url_info(request, settings): | |
# Need this to get port included when not 80,443. | |
request.host = None | |
request.scheme = settings['scripts.server_scheme'] | |
request.server_name = settings['scripts.server_name'] | |
request.server_port = settings['scripts.server_port'] |
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 set_request_url_info(request, settings): | |
# Need this to get port included when not 80,443. | |
request.host = None | |
request.scheme = settings['scripts.server_scheme'] | |
request.server_name = settings['scripts.server_name'] | |
request.server_port = settings['scripts.server_port'] |
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
upstream proxy_example_com { | |
server 127.0.0.1:5000; | |
} | |
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
server { | |
listen 80; | |
server_name proxy.example.com; |
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
/*globals jQuery*/ | |
require([ | |
"dojo/domReady!" | |
], function () { | |
"use strict"; | |
var slideshow = { | |
imageTransitionDuration: 400, | |
imagePollTimeout: 5000, | |
imagePollFrequency: 100, | |
init: function (slideshowEl) { |
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
2013-06-30 16:51:59,609 ERROR [pyramid_debugtoolbar][Dummy-2] Exception at http://localhost:6543/events | |
traceback url: http://localhost:6543/_debug_toolbar/exception?token=da6152730325fdebcfa1&tb=55887184 | |
Traceback (most recent call last): | |
File "/home/ian/workspace/scramble-project/ve/lib/python2.7/site-packages/pyramid_debugtoolbar-1.0.6-py2.7.egg/pyramid_debugtoolbar/toolbar.py", line 141, in toolbar_tween | |
response = _handler(request) | |
File "/home/ian/workspace/scramble-project/ve/lib/python2.7/site-packages/pyramid_debugtoolbar-1.0.6-py2.7.egg/pyramid_debugtoolbar/panels/performance.py", line 55, in resource_timer_handler | |
result = handler(request) | |
File "/home/ian/workspace/scramble-project/ve/lib/python2.7/site-packages/pyramid/tweens.py", line 40, in excview_tween | |
response = view_callable(exc, request) | |
File "/home/ian/workspace/scramble-project/ve/lib/python2.7/site-packages/pyramid/config/views.py", line 377, in viewresult_to_response |