Skip to content

Instantly share code, notes, and snippets.

@leonzhao2020
leonzhao2020 / README.md
Created May 26, 2020 09:39 — forked from Integralist/README.md
[Tornado AsyncHTTPClient - No Web Server] #python #pipenv #tornado #async #concurrency #httpclient #asynchttpclient #tox #ini #basicauth #auth

Set-up the environment:

See this gist for more information on Pipenv.

  • pipenv --python 3.7
  • pipenv shell
  • pipenv install tornado==5.0.2
  • pipenv install --dev mypy tox flake8
@leonzhao2020
leonzhao2020 / app.py
Created May 10, 2016 06:28 — forked from vgoklani/app.py
Using Flask to output Python data to High Charts
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
@app.route('/index')
def index(chartID = 'chart_ID', chart_type = 'bar', chart_height = 350):
chart = {"renderTo": chartID, "type": chart_type, "height": chart_height,}
series = [{"name": 'Label1', "data": [1,2,3]}, {"name": 'Label2', "data": [4, 5, 6]}]
title = {"text": 'My Title'}
@leonzhao2020
leonzhao2020 / nginx
Last active September 18, 2015 08:21 — forked from vdel26/nginx
Openresty init.d script
#!/bin/sh
#
# chkconfig: 2345 55 25
# Description: Nginx init.d script, put in /etc/init.d, chmod +x /etc/init.d/nginx
# For Debian, run: update-rc.d -f nginx defaults
# For CentOS, run: chkconfig --add nginx
#
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
@leonzhao2020
leonzhao2020 / bottle_example.py
Last active August 29, 2015 14:27 — forked from Arthraim/bottle_example.py
a python web framework bottle's example
#coding: utf-8
from bottle import route, error, post, get, run, static_file, abort, redirect, response, request, template
@route('/')
@route('/index.html')
def index():
return '<a href="/hello">Go to Hello World page</a>'
@route('/hello')
def hello():