start new:
tmux
start new with session name:
tmux new -s myname
# create stub, then run flask app in tornado on port 5000 (perhaps with supervisord config below http://supervisord.org/index.html) | |
#!/usr/bin/env python | |
from tornado.wsgi import WSGIContainer | |
from tornado.httpserver import HTTPServer | |
from tornado.ioloop import IOLoop | |
from myflaskapp import app | |
http_server = HTTPServer(WSGIContainer(app)) |
(ns willwear.models.thing-model | |
(:require [willwear.storage.db.ww-storage :as storage])) | |
(defn register-new-thing [session-token thing-tags thing-name thing-summary & {:keys [db] :or {db storage/willwear-db}}] | |
(let [user-uid (:user_uid (storage/check-user-session session-token :db db))] | |
(let [user-data (storage/get-user-by-uid user-uid :db db)] | |
(storage/add-new-thing user-uid thing-name thing-summary nil)))) |
from flask import Flask, request, redirect, url_for, make_response, abort | |
from werkzeug import secure_filename | |
from pymongo import Connection | |
from pymongo.objectid import ObjectId | |
from gridfs import GridFS | |
from gridfs.errors import NoFile | |
ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) | |
DB = Connection().gridfs_server_test | |
FS = GridFS(DB) |
EMAIL_HOST = 'smtp.yandex.ru' | |
EMAIL_HOST_USER = 'login@example.com' | |
EMAIL_HOST_PASSWORD = 'password' | |
EMAIL_PORT = 465 | |
EMAIL_USE_TLS = True |
# -*- coding: utf-8 -*- | |
from flask import request, session, redirect, url_for, render_template | |
from flask import Response | |
from flask import jsonify, make_response | |
from bson.json_util import dumps | |
from bson.objectid import ObjectId | |
from mobile import app, mongo, mongofs |
FROM python:3.5.3-onbuild | |
VOLUME ["/usr/src/app/staticfiles"] | |
CMD ["gunicorn", "--access-logfile", "-", "--error-logfile", "-", "-b", "0.0.0.0:8000", "app.wsgi", "-w", "4", "--preload"] | |
EXPOSE 8000 |
#!/bin/bash | |
# Delete Archived Applications | |
rm -r ~/Library/Developer/Xcode/Archives/*/ | |
# Delete Devired Data | |
rm -r ~/Library/Developer/Xcode/DerivedData/*/ | |
# Delete Apple cached files | |
rm -r ~/Library/Developer/CoreSimulator/Caches/dyld/*/*/ |