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
In [1]: from sqlalchemy.ext.declarative import declarative_base | |
In [2]: Base = declarative_base() | |
In [3]: from sqlalchemy import Column, Integer, String | |
In [4]: class User(Base): | |
...: __tablename__ = 'users' | |
...: id = Column(Integer, primary_key=True) | |
...: name = Column(String) |
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
# Most part of this file is created by https://www.gitignore.io | |
### Node ### | |
# Logs | |
logs | |
*.log | |
# Runtime data | |
pids | |
*.pid |
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
''' | |
This code is an example of Flask-SuperAdmin app with basic authentication. Use it for anything you like. | |
Based on this snippet: http://flask.pocoo.org/snippets/8/ | |
''' | |
import flask | |
from flask.ext.superadmin import Admin, expose, AdminIndexView as _AdminIndexView | |
from flask.ext.superadmin.model import ModelAdmin as _ModelAdmin | |
from flask.ext.sqlalchemy import SQLAlchemy |
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
/** | |
* @author Anatoly Mironov (mirontoli) | |
* http://sharepointkunskap.wordpress.com | |
* http://www.bool.se | |
* | |
* http://stackoverflow.com/questions/3605495/generate-a-list-of-localized-language-names-with-links-to-google-translate/14800384#14800384 | |
* http://stackoverflow.com/questions/10997128/language-name-from-iso-639-1-code-in-javascript/14800499#14800499 | |
* | |
* using Phil Teare's answer on stackoverflow | |
* http://stackoverflow.com/questions/3217492/list-of-language-codes-in-yaml-or-json/4900304#4900304 |
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 simplejson | |
import sqlalchemy | |
from sqlalchemy import String | |
from sqlalchemy.ext.mutable import Mutable | |
class JSONEncodedObj(sqlalchemy.types.TypeDecorator): | |
"""Represents an immutable structure as a json-encoded string.""" | |
impl = String |
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
%TAG !foo! tag:gronr.com,2010: | |
--- | |
- Group: | |
- name: blues | |
- name: reds | |
- name: squares |
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
[global] | |
default-timeout = 60 | |
respect-virtualenv = true | |
download-cache = ~/.pip/cache | |
log-file = ~/.pip/pip.log | |
build = ~/.pip/build | |
[install] | |
use-mirrors = true |