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
from .app import App | |
from .db import get_dbsession | |
from .models import User | |
@App.method(App.dbsession) | |
def app_dbsession(app): | |
return get_dbsession(app.settings.sqlalchemy.__dict__) | |
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 morepath | |
from pymitter import EventEmitter | |
class App(morepath.App): | |
ee = EventEmitter() | |
@App.ee.on('myevent') | |
def handler1(arg, request): |
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 morepath | |
from reg import match_key | |
class App(morepath.App): | |
@morepath.dispatch_method(match_key('name')) | |
def service(self, name): | |
raise NotImplementedError |
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
Verifying that +blaflamme is my blockchain ID. https://onename.com/blaflamme |
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
var path = require('path'); | |
var webpack = require('webpack'); | |
var ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
var SwigWebpackPlugin = require('swig-webpack-plugin'); | |
var node_modules_dir = path.resolve(__dirname, 'node_modules'); | |
var vendors_dir = path.resolve(__dirname, 'src/client/vendors'); | |
var templates = require('./webpack.tmpl.config').templates; | |
var config = { | |
addVendor: function (name, 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
# file.path = '/a/apth/to/a/file' | |
# file.filename = 'something.jpg' | |
response = FileResponse(file.path) | |
response.content_disposition = 'attachment;filename="{}"'.format(file.filename) | |
return response |
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 -*- | |
from sqlalchemy import engine_from_config | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import sessionmaker | |
from zope.sqlalchemy import register | |
Base = declarative_base() |
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 -*- | |
from sqlalchemy import engine_from_config | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import sessionmaker | |
from zope.sqlalchemy import register | |
Base = declarative_base() |
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 -*- | |
from pyramid.interfaces import IRequest | |
from pyramid.settings import asbool | |
try: | |
import pyramid_services | |
except: | |
pyramid_services = None |
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
from __future__ import unicode_literals | |
from itertools import ifilter | |
from pyramid.config import Configurator | |
from pyramid.response import Response | |
from pyramid.view import view_config, view_defaults | |
from wsgiref.simple_server import make_server |
NewerOlder