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 socket | |
| import select | |
| import sys | |
| # Start this server locally as follows | |
| # python server.py 127.0.0.1 4444 1 | |
| BACKLOG = 1 | |
| def cmd_help(user, msg): |
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 flask import Flask | |
| from flask.ext.admin import Admin | |
| from flask.ext.admin.contrib.sqla import ModelView | |
| from sqlalchemy.orm import mapper | |
| from sqlalchemy import Table, Column | |
| from sqlalchemy.orm import sessionmaker | |
| from sqlalchemy.engine import create_engine | |
| from sqlalchemy import MetaData | |
| from sqlalchemy import ( |
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 flask import Flask | |
| from flask.ext.admin import Admin | |
| from flask.ext.admin.contrib.sqla import ModelView | |
| from sqlalchemy.orm import mapper | |
| from sqlalchemy import Table, Column | |
| from sqlalchemy.orm import sessionmaker | |
| from sqlalchemy.engine import create_engine | |
| from sqlalchemy import MetaData | |
| from sqlalchemy import ( |
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
| var BackboneMixin; | |
| BackboneMixin = { | |
| componentDidMount: function(node) { | |
| if (this.props.model) { | |
| return this.watchBackbone(this.props.model); | |
| } | |
| }, | |
| componentWillUnmount: function() { | |
| return this.unwatchBackboneAll(); |
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
| var RootPage = React.createClass({ | |
| render: function() { | |
| if (this.props.page) { | |
| return this.props.page; | |
| } else { | |
| return <div /> | |
| } | |
| } | |
| }); |
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 lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <style> | |
| .some { | |
| background-color: black; | |
| } | |
| </style> | |
| </head> |
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
| Requirements: Postgresql, Flask-Admin, Flask-Sqlalchemy | |
| How to run it: | |
| createdb inline_bug | |
| psql inline_bug -af schema.sql | |
| python app.py | |
| Go to /admin and try to edit the servers. One will work, one will not. |
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 flask import Flask | |
| from flask.ext.sqlalchemy import SQLAlchemy | |
| from flask.ext import admin, wtf | |
| from flask.ext.admin.contrib import sqlamodel | |
| from flask.ext.admin.contrib.sqlamodel import filters | |
| # Create application | |
| app = Flask(__name__) |
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 flask import Flask | |
| from flask.ext.sqlalchemy import SQLAlchemy | |
| from flask.ext import admin, wtf | |
| from flask.ext.admin.contrib import sqlamodel | |
| from flask.ext.admin.contrib.sqlamodel import filters | |
| # Create application | |
| app = Flask(__name__) |
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
| with gen.task: | |
| @gen.engine | |
| def test(): | |
| result = yield gen.Task(somefunc, 10) | |
| print result | |
| without: | |
| def test(): |