This file contains hidden or 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
# -*- Encoding: utf-8 -*- | |
import base64 | |
import binascii | |
import cgi | |
import hashlib | |
import hmac | |
import logging | |
import time | |
import urllib | |
import urlparse |
This file contains hidden or 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
import os,time | |
while(True): | |
time.sleep(3) | |
os.system("eject") | |
time.sleep(3) | |
os.system("eject -t") |
This file contains hidden or 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
import tornado.ioloop | |
import tornado.web | |
import MySQLdb | |
def get_conn(): | |
db = MySQLdb.connect("localhost","alex","1qasw2","test") | |
#db.autocommit(False) | |
return db | |
def query(db): |
This file contains hidden or 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
DATALIST="""<?xml version="1.0" encoding="utf-8"?> | |
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> | |
<soap12:Body> | |
<GetDataListByDate xmlns="http://tempuri.org/"> | |
<token>%(token)s</token> | |
<fromDate>%(fdate)s</fromDate> | |
<toDate>%(tdate)s</toDate> | |
</GetDataListByDate> | |
</soap12:Body> | |
</soap12:Envelope>""" |
This file contains hidden or 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
#coding=utf8 | |
import pybcs | |
import logging | |
pybcs.init_logging(logging.INFO) | |
AK = '' #请改为你的AK | |
SK = '' #请改为你的SK | |
BUCKET='myimage1' |
This file contains hidden or 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
#-*- coding:utf-8 -*- | |
from flask import Flask, g, request | |
app = Flask(__name__) | |
app.debug = True | |
@app.route('/') | |
def hello(): | |
return "Hello, world! - Flask\n" |
This file contains hidden or 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 WordsArr(object): | |
def __init__(self,col_count): | |
self.total = 26**col_count | |
def __getitem__(self,idx): | |
if idx>self.total-1: | |
raise IndexError("index out of range") | |
nums = [] | |
lst = idx%26 | |
while idx/26: |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<script src="/jquery.js"></script> | |
<script src="/jsbn.js"></script> | |
<script src="/rsa.js"></script> | |
<script src="/sha1.js"></script> | |
<script type="text/javascript"> | |
function encrypt() { |
This file contains hidden or 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
$.fn.extend({ | |
gist:function(){ | |
var r = /(https\:\/\/gist\.github\.com\/\w+\/\d+)/g; | |
this.each(function(index){ | |
var content = $(this).html(); | |
content = content.replace(r,"<script src=\"$1.js\"></script>"); | |
$(this).html(content); | |
}); | |
return true; | |
}, |
This file contains hidden or 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
import requests | |
import datetime | |
from bs4 import BeautifulSoup | |
import random | |
def get_page(url): | |
r=requests.get(url,headers={"content-type":"text","User-Agent":"Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11"}) | |
return BeautifulSoup(r.text) | |
OlderNewer