Skip to content

Instantly share code, notes, and snippets.

View pigletfly's full-sized avatar
🎯
Focusing

Bing Wang pigletfly

🎯
Focusing
  • Hangzhou
  • 23:48 (UTC +08:00)
View GitHub Profile
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# code by from1to9
# [email protected]
import oauth2 as oauth
import re, time
worker_processes 2;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
}
@pigletfly
pigletfly / README
Created May 21, 2014 01:35 — forked from thedod/README
A simple trick against CSRF for web.py (webpy.org)
* At the GET() template, you add a hidden field called csrf_token with value "$csrf_token()"
* The POST() should have the @csrf_protected decorator
That's it.
Request for comments:
* Is this secure? Can you see any holes?
* Is there anything in [or for] web.py that does this? Am I reinvevting the wheel here?