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
#!/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 |
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
## Google全球IP地址库 | |
=====>> [宽屏查看](./README.md) <<===== | |
+短地址①:<http://tinyurl.com/Google-IPs> | |
+短地址②:<http://dwz.cn/Google-IPs> | |
<table> | |
<tbody> | |
<tr> |
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
#!/usr/bin/env python | |
""" | |
Very simple HTTP server in python. | |
Usage:: | |
./dummy-web-server.py [<port>] | |
Send a GET request:: | |
curl http://localhost |
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
#!/usr/bin/python | |
#-*- coding: UTF-8 -*- | |
import sys | |
import string,cgi,time | |
import xml.etree.ElementTree as ET | |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
URL_ROUTE = { | |
'/baidu/' : 'http://baidu.com/', |
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
demo | |
*.swp |
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
#ifndef __RESULT_CODE__ | |
#define __RESULT_CODE__ | |
#include <string> | |
#include <iostream> | |
using std::string; | |
using std::ostream; | |
namespace Result | |
{ |
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 bottle import * | |
from bottlepy_user_auth import User | |
def validate_login(): | |
return User().loggedin | |
def login_required(view, check_func=validate_login): | |
''' |
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
class RepeatingTimer(_Timer): | |
def __init__(self, init_delay, interval, function, args=[], kwargs={}): | |
_Timer.__init__(self, interval, function, *args, **kwargs) | |
self.init_delay = init_delay | |
def run(self): | |
self.finished.wait(self.init_delay) | |
self.function(*self.args, **self.kwargs) | |
while not self.finished.is_set(): |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from functools import wraps | |
from bottle import request | |
def login(): | |
def decorator(func): | |
@wraps(func) |
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
// watches the source directory for changes and synchronize to destination directory | |
package main | |
import ( | |
"flag" | |
"fmt" | |
"log" | |
"os" | |
"path/filepath" | |
"strings" |
OlderNewer