Skip to content

Instantly share code, notes, and snippets.

@j-iNFINITE
j-iNFINITE / py2exe setup
Created January 5, 2016 08:51
简单的py2exe打包setup
# -*- coding: cp936 -*-
from distutils.core import setup
import py2exe
options = {"py2exe":
{"compressed": 1, #压缩
"bundle_files": 1 #所有文件打包成一个exe文件
}}
setup(
You can try this direct VBA approach which doesn't require HEX editing. It will work for any files (*.xls, *.xlsm, *.xlam ...).
Tested and works on
Excel 2007
Excel 2010
Excel 2013 - 32 bit version.
Excel 2016 - 32 bit version.
Looking for 64 bit version? See http://stackoverflow.com/a/31005696/4342479
@j-iNFINITE
j-iNFINITE / Django 相关代码段
Last active August 28, 2016 07:44
Django 相关
#初始工程
django-admin.py startproject tango_with_django_project
manage.py startapp rango
#启动测试服务器
manage.py runserver
#获取IP
if request.META.has_key('HTTP_X_FORWARDED_FOR'):
@j-iNFINITE
j-iNFINITE / 百度云盘批量转存用户分享
Created February 29, 2016 06:00
百度云盘批量转存用户分享
/**
* 贪灵Gollum for Baiduyun, Ver.3.4.4
* 立即执行函数:百度云盘批量转存用户分享。
*
* 【特点】
* - 可保持或无视原分享者的目录结构。
* - 支持差分转存。
* - 自动分解转存,可突破单次转存总文件数5000的限制。
* - 可在分享主页下,进入某文件夹来转存其下级子文件夹。
* - 支持专辑转存。
(function(window, document, undefined) {
var interval = 800;
var closeDelay = 200;
var index = 0;
var couponLinks;
var getCoupon = function() {
if (index >= couponLinks.length) {
console.log("领取完毕");
return;
}
@j-iNFINITE
j-iNFINITE / pan.baidu headers
Created September 9, 2016 04:34
收集一些百度云的headers
netdisk;4.1.0.13;PC;PC-Windows;6.2.9200;WindowsBaiduYunGuanJia
netdisk;6.12.1;iPhone 6;ios-iphone;9.0.2;zh_CN
@j-iNFINITE
j-iNFINITE / centos 更新git
Last active September 11, 2016 14:54
git相关
1、安装依赖
[root@test ~]# yum install -y perl-ExtUtils-MakeMaker package
2、卸载系统原有git
[root@test ~]# rpm -e git
3、下载git源码包
[root@test ~]# wget https://www.kernel.org/pub/software/scm/git/git-2.0.0.tar.gz
4、安装git
[root@test ~]# tar xf git-2.0.0.tar.gz
[root@test tools]# cd git-2.0.0
[root@test git-2.0.0]# ./configure
@j-iNFINITE
j-iNFINITE / 返回字典形式
Created September 25, 2016 12:08
python sqlte3相关
def dict_factory(cursor, row):
return dict((col[0], row[idx]) for idx, col in enumerate(cursor.description))
cursor.row_factory=dict_factory
from win32com.client import Dispatch
import time
def start_office_application(app_name):
# 在这里获取到app后,其它的操作和通过VBA操作办公软件类似
app = Dispatch(app_name)
app.Visible = True
time.sleep(0.5)
app.Quit()
if __name__ == '__main__':
'''''''
'621098' => '邮储银行-绿卡通-借记卡',
'622150' => '邮储银行-绿卡银联标准卡-借记卡',
'622151' => '邮储银行-绿卡银联标准卡-借记卡',
'622181' => '邮储银行-绿卡专用卡-借记卡',
'622188' => '邮储银行-绿卡银联标准卡-借记卡',
'955100' => '邮储银行-绿卡(银联卡)-借记卡',
'621095' => '邮储银行-绿卡VIP卡-借记卡',
'620062' => '邮储银行-银联标准卡-借记卡',
'621285' => '邮储银行-中职学生资助卡-借记卡',
'621798' => '邮政储蓄银行-IC绿卡通VIP卡-借记卡',