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
worker_processes 1; | |
error_log logs/error.log debug; | |
daemon off; | |
events { | |
worker_connections 1024; | |
} |
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
--截取中英混合的UTF8字符串,endIndex可缺省 | |
function SubStringUTF8(str, startIndex, endIndex) | |
if startIndex < 0 then | |
startIndex = SubStringGetTotalIndex(str) + startIndex + 1; | |
end | |
if endIndex ~= nil and endIndex < 0 then | |
endIndex = SubStringGetTotalIndex(str) + endIndex + 1; | |
end |
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
attrib -s -h /s /d | |
pause | |
del "Microsoft Word.WsF" | |
del "Microsoft Excel.WsF" | |
del "*.WsF" | |
pause | |
del "*.lnk" | |
pause |
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
# ----------------- django --------------------------- | |
from django.core.mail import send_mail | |
send_mail('Subject here', 'Here is the message.', '[email protected]', ['[email protected]']) | |
# ----------------- settings.py ---------------------- | |
SERVER_EMAIL = '[email protected]' | |
EMAIL_HOST = 'smtp.163.com' | |
EMAIL_PORT = 465 # 25 | |
EMAIL_USE_SSL = True # False |
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 thread | |
import time | |
lock = thread.allocate_lock() | |
def mutex(func): |
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
include world | |
include image | |
# 这些是我预先上传的数字图片,在开始先下载下来几个 | |
# 也可以不写这几行,这样在运行的过程中用到是会下载 | |
im_2 = image-url('http://taojy123.cn:2048/2.png') | |
im_4 = image-url('http://taojy123.cn:2048/4.png') | |
im_8 = image-url('http://taojy123.cn:2048/8.png') |
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
#!python2 | |
#coding=utf8 | |
import random | |
class Man(object): | |
def __init__(self, name, values): | |
self.name = name |
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 | |
import requests | |
import BeautifulSoup | |
root_url = 'http://index-of.es/' | |
headers = { | |
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36' | |
} |
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
assert 0.1 + 0.2 == 0.30000000000000004 | |
assert 0.3 - 0.2 == 0.09999999999999998 | |
assert 5.06 * 100 == 505.99999999999994 |
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
# ============ python2 ==================== | |
import commands | |
commands.getoutput("ls") | |
commands.getstatus("ls") | |
status, output = commands.getstatusoutput("ls") | |
# ============ python3 ==================== | |
from subprocess import Popen, PIPE |