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
#!/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/*/*/ |
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 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 |
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 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 |
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
EMAIL_HOST = 'smtp.yandex.ru' | |
EMAIL_HOST_USER = 'login@example.com' | |
EMAIL_HOST_PASSWORD = 'password' | |
EMAIL_PORT = 465 | |
EMAIL_USE_TLS = True |
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 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) |
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
(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)))) |
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
# 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)) |
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
//function | |
jQuery.fn.loadComplete = function (fn) { | |
return this.each(function () { | |
if (this.complete || this.readyState == 'complete') { | |
fn.call(this); | |
} else { | |
$(this).load(fn); | |
} | |
}); | |
}; |
NewerOlder