Skip to content

Instantly share code, notes, and snippets.

@js2854
js2854 / login_required
Created September 28, 2018 01:34 — forked from vsergeyev/login_required
@login_required decorator to use with bottle.py
from bottle import *
from bottlepy_user_auth import User
def validate_login():
return User().loggedin
def login_required(view, check_func=validate_login):
'''
@js2854
js2854 / .gitignore
Last active August 29, 2015 14:13 — forked from reagent/.gitignore
Curses Windowing Example
demo
*.swp
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@js2854
js2854 / rewrite.py
Created September 9, 2013 07:28 — forked from binux/rewrite.py
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<[email protected]>
# http://binux.me
# Created on 2012-09-06 22:22:21
import urlparse
import re