移植自 Dant 的 FlvPatcher [http://danknest.org]
> https://github.com/dantmnf/FlvPatcher/blob/master/blacker.sh
于 Linux Mint 16 下测试通过。
sudo apt-get install libav-tools ffmsindex mkvtoolnix mediainfo nodejs && npm install sequence
#用正则简单过滤html的<>标签 | |
import re | |
str = "<img /><a>srcd</a>hello</br><br/>" | |
str = re.sub(r'</?\w+[^>]*>','',str) | |
print str |
#!/usr/bin/env python | |
# | |
# Copyright 2001-2002 by Vinay Sajip. All Rights Reserved. | |
# | |
# Permission to use, copy, modify, and distribute this software and its | |
# documentation for any purpose and without fee is hereby granted, | |
# provided that the above copyright notice appear in all copies and that | |
# both that copyright notice and this permission notice appear in | |
# supporting documentation, and that the name of Vinay Sajip | |
# not be used in advertising or publicity pertaining to distribution |
r""" | |
sqlassist | |
~~~~~~~~~ | |
v0.3 | |
sections of code taken from : | |
- Mike Orr's package 'sqlahelper' | |
- Mike Bayer's blog post 'Django-style Database Routers in SQLAlchemy' | |
#coding=utf-8 | |
import time | |
import sched | |
import os | |
import threading | |
""" | |
sched模块,准确的说,它是一个调度(延时处理机制),每次想要定时执行某任务都必须写入一个调度。 | |
使用步骤如下: | |
(1)生成调度器: | |
s = sched.scheduler(time.time,time.sleep) |
#!/usr/bin/python | |
# The urlparse module provides functions for breaking URLs down into their | |
# component parts, as defined by the relevant RFCs. | |
from urlparse import urlparse | |
# PARSING | |
parsed = urlparse('http://user:pass@NetLoc:80/path;parameters?query=argument#fragment') |
# coding=utf8 | |
import PIL | |
from PIL import ImageFont | |
from PIL import Image | |
from PIL import ImageDraw | |
def text2png(text, fullpath, color = "#000", bgcolor = "#FFF", fontfullpath = None, fontsize = 13, leftpadding = 3, rightpadding = 3, width = 200): | |
REPLACEMENT_CHARACTER = u'\uFFFD' | |
NEWLINE_REPLACEMENT_STRING = ' ' + REPLACEMENT_CHARACTER + ' ' |
移植自 Dant 的 FlvPatcher [http://danknest.org]
> https://github.com/dantmnf/FlvPatcher/blob/master/blacker.sh
于 Linux Mint 16 下测试通过。
sudo apt-get install libav-tools ffmsindex mkvtoolnix mediainfo nodejs && npm install sequence
var uuid = require('node-uuid'), | |
https = require('https'); | |
function iCloud(appleId, password) { | |
this.urls = { | |
"version" : "https://www.icloud.com/system/version.json", | |
"validate": "/setup/ws/1/validate?clientBuildNumber={0}&clientId={1}", | |
"login": "/setup/ws/1/login?clientBuildNumber={0}&clientId={1}" | |
} |
# -*- coding: utf-8 -*- | |
# | |
# Author: oldj | |
# Email: oldj.wu@gmail.com | |
# Blog: http://oldj.net | |
# | |
import os | |
import re | |
import StringIO |
import smtplib | |
from getpass import getpass | |
def prompt(prompt): | |
return input(prompt).strip() | |
fromaddr = prompt("From: ") | |
toaddrs = prompt("To: ").split() | |
subject = prompt("Subject: ") | |
print("Enter message, end with ^D (Unix) or ^Z (Windows):") |