Skip to content

Instantly share code, notes, and snippets.

View fffonion's full-sized avatar

Wangchong Zhou fffonion

View GitHub Profile
@fffonion
fffonion / dm123bot.py
Last active December 23, 2015 14:39
a vely vely ugly scrlipt for converting dm123 xinfan jieshao to BBCode
#coding=utf-8
__version__=1.4
#1.2 修正补全图片url时出现的bug
#1.3 htmlescape
#1.4 flash的BBCOD优化,调整大小;字体调整为雅黑,标题放大
import urllib2,re,win32clipboard as clipboard,time,win32con,os,sys
import random
import httplib2
import datetime
baseurl='http://www.dm123.cn'
@fffonion
fffonion / ma_calc.py
Created October 15, 2013 03:41
MA收集品、妖精血量、妖精攻击计算器
import math
class calc():
WAKE_FAIRY,NORMAL_FAIRY=True,False
NORMAL_FAIRY_1,NORMAL_FAIRY_2,WAKE_FAIRY=0,1,2
@classmethod
def item_get(cls,fairy_lv,is_wake=False,damage_hp=0):
'''
收集品获得量计算器
'''
@fffonion
fffonion / eclipse_package_cleaner.py
Last active December 25, 2015 18:29
cleanup old eclipse packages
import os
import re
from distutils.version import LooseVersion, StrictVersion
#def versiontuple(v):
# return tuple(map(int, (v.split("."))))
dir='D:\\Dev\\Java\\eclipse.x86\\plugins'
del_dir=os.path.join(dir,'_delete')
plugin=os.listdir(dir)
plugin_dict={}
for p in plugin:
@fffonion
fffonion / duowan_gift.py
Created October 25, 2013 16:25
领多玩礼包
#coding:utf-8
import httplib2
import hashlib
import random
import json
alphanum='0123456789abcdef'
verify=lambda x:hashlib.md5("J]KcRe(dxmk5cMS-%sJ]KcRe(dxmk5cMS-"%x).hexdigest()
mac_gen=lambda :':'.join([random.choice(alphanum)+random.choice(alphanum)*(j/j) for j in range(1,6) ])
mac=mac_gen()
uri='mac=%sverify=%s'%(mac,verify(mac))
@fffonion
fffonion / DEC2BIN&HEX.asm
Last active December 28, 2015 16:09
HUST微机原理实验x3 感受一下寄存器脑残粉的恶意
data segment
OBUF DB '$'
OBUF1 DB 0AH,0DH,'Please input N(0-255):$'
IBUF DB 3 DUP(?),'=$'
OUT_D DB 0AH,0DH,'N=$'
OUT_H DB 'H=$'
OUT_B DB 'B',0AH,0DH,'$'
data ends
code segment
@fffonion
fffonion / decode_cdp.py
Created December 10, 2013 12:04
ComicDown(千寻漫画盒) cdp文件解包器
#!/usr/bin/env python2
# coding:utf-8
# Tool for decoding ComidDown site files (.cdp)
# Contributor:
# fffonion <fffonion@gmail.com>
import json
import struct
import zlib
f=open(r'178.cdp','rb')
cnt,sign=struct.unpack('<Ix3s',f.read(8))
@fffonion
fffonion / Apache Config
Last active August 7, 2019 06:02
Wiki Mirror 维基百科镜像,B64加密超链接防止撞墙 https://wc.yooooo.us ,附apache和nginx配置
#Redirect 301 ^/$ /search.htm
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
<FilesMatch ".(gif|jpg|jpeg|png|ico|css|js)$">
Header unset Pragma
@fffonion
fffonion / query_4px.py
Last active August 29, 2015 13:57
四方转运怨念累积每日查询用脚本【摔
#coding:utf-8
from httplib2 import Http
import re
import time
today = time.strftime('%Y-%m-%d 00:00:00',time.localtime(time.time()))
ticket = "xxxxxxxxxxxxxxxxxx"
a,b = Http("Z:\TEMP").request("http://www.transrush.com/Transport/LogisticsTransferTrace.aspx?code=%s" % ticket,
headers = {"Referer":"http://tr.4px.com/Transport/TransportInfo.aspx",
"Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Encoding":"gzip,deflate",
@fffonion
fffonion / .htaccess
Last active September 20, 2023 00:40
Google镜像 恢复背景图片,代理谷歌快照,去除了url跳转,关闭安全搜索 http://g.yooooo.ushttp://gc.yooooo.us
#Redirect 301 ^/$ /search.htm
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_URI} !^/index\.htm
#RewriteCond %{REQUEST_URI} !^/image\.htm
#RewriteCond %{REQUEST_URI} !^/m\.htm
#RewriteCond %{REQUEST_URI} !^/mi\.htm
@fffonion
fffonion / KHimekuri.py
Created April 18, 2014 07:52
download K Project everyday wallpaper
from __future__ import print_function
from Crypto.Cipher import AES
import os, os.path as opath
import binascii
import time
from datetime import datetime, timedelta
from httplib2 import Http
pad = lambda s: s + (16 - len(s) % 16) * chr(16 - len(s) % 16)
unpad = lambda s : s[0:-ord(s[-1])]