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
#用正则简单过滤html的<>标签 | |
import re | |
str = "<img /><a>srcd</a>hello</br><br/>" | |
str = re.sub(r'</?\w+[^>]*>','',str) | |
print str |
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 | |
def getNewId(oldid): | |
# 将输入的oldid参数拆分成元组 | |
a=[] | |
for i in oldid: | |
a.append(int(i)) | |
# 在第6和7位(从0开始计算)填入1和9,组成长度为17的元组 | |
a.insert(6,1) |
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
ss = document.getElementsByTagName('select'); | |
for (var i = 0; i < ss.length; i++) { | |
var se = ss[i]; | |
for (var j = 0; j < se.options.length; j++) { | |
if(se.options[j].text=='只读'){ | |
se.options[j].selected = true; | |
} | |
} | |
} |
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
import urllib | |
import urllib2 | |
import os | |
picurl="http://images.51cto.com/files/uploadimg/20100630/104906665.jpg" | |
save_path="d:\\" | |
imgData = urllib2.urlopen(picurl).read() | |
# 给定图片存放名称 | |
fileName = save_path + "\\ddd.jpg" | |
# 文件名是否存在 |
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 urllib | |
import urllib2 | |
import re | |
import threading | |
import Queue | |
url = 'https://who.is/whois/name_search/' |
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
# -*- coding: utf-8 -*- | |
import codecs | |
import urllib2 | |
import json | |
from sets import Set | |
""" | |
一个用来检测字符表里面是否有可用的拼音域名的脚本 | |
http://pypi.python.org/pypi/chardet 用来检测编码 | |
""" | |
f = codecs.open('data/pinyin.dic', encoding='utf-8') |
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
<table> | |
<tr> | |
<td width="80px" bgcolor="#f5f5f5"> | |
<label for="box" style="display:block;line-height:80px"> | |
<input id='box' name="chco" value="" type="checkbox"> | |
</label> | |
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 | |
# | |
# Converts any integer into a base [BASE] number. I have chosen 62 | |
# as it is meant to represent the integers using all the alphanumeric | |
# characters, [no special characters] = {0..9}, {A..Z}, {a..z} | |
# | |
# I plan on using this to shorten the representation of possibly long ids, | |
# a la url shortenters | |
# |
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
function build_http_query($params) { | |
if (!$params) return ''; | |
// Urlencode both keys and values | |
$keys = array_keys($params); | |
$values = array_values($params); | |
//$keys = OAuthUtil::urlencode_rfc3986(array_keys($params)); | |
//$values = OAuthUtil::urlencode_rfc3986(array_values($params)); | |
$params = array_combine($keys, $values); |
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
.markdown-body { | |
font-size: 14px; | |
line-height: 1.6; | |
} | |
.markdown-body > *:first-child { | |
margin-top: 0 !important; | |
} | |
.markdown-body > *:last-child { | |
margin-bottom: 0 !important; | |
} |
NewerOlder