Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
from geventwebsocket.handler import WebSocketHandler | |
from gevent.pywsgi import WSGIServer | |
from flask import Flask, request, render_template | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return render_template('index.html') |
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
#threads | |
import thread | |
import threading | |
import time | |
class ThreadTask(threading.Thread): | |
def __init__(self,name,delay,callback): | |
threading.Thread.__init__(self) | |
/** | |
* An AngularJS directive for Dropzone.js, http://www.dropzonejs.com/ | |
* | |
* Usage: | |
* | |
* <div ng-app="app" ng-controller="SomeCtrl"> | |
* <button dropzone="dropzoneConfig"> | |
* Drag and drop files here or click to upload | |
* </button> | |
* </div> |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os | |
from twisted.application import service | |
from twisted.web import server, static | |
from twisted.web.resource import Resource | |
from twisted.web.wsgi import WSGIResource | |
from twisted.internet import reactor | |
from flask.views import MethodView |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.