├── z42 ├── __init__.py ├── js │ ├── _WEB │ │ └── __init__.py │ ├── hack │ │ ├── placeholder.js │ │ └── ie8.js │ ├── __init__.py │ ├── foot.js │ ├── _lib │ │ ├── uploadify.swf │ │ ├── webcam │ │ │ └── webcam.swf │ │ ├── imgareaselect │ │ │ ├── Moxie.swf │ │ │ └── Moxie.xap │ │ ├── upload.js │ │ ├── trim.js │ │ └── jquery.zh_cn.js │ ├── _env.py │ ├── readme.rst │ └── init.js ├── static │ ├── x.txt │ ├── js │ │ ├── _WEB │ │ │ └── __init__.py │ │ ├── hack │ │ │ ├── placeholder.js │ │ │ └── ie8.js │ │ ├── __init__.py │ │ ├── foot.js │ │ ├── _lib │ │ │ ├── uploadify.swf │ │ │ ├── webcam │ │ │ │ └── webcam.swf │ │ │ ├── imgareaselect │ │ │ │ ├── Moxie.swf │ │ │ │ └── Moxie.xap │ │ │ ├── upload.js │ │ │ ├── trim.js │ │ │ └── jquery.zh_cn.js │ │ ├── _env.py │ │ ├── readme.rst │ │ └── init.js │ ├── html │ │ └── sort │ │ │ ├── test │ │ │ └── 2.json │ │ │ ├── js │ │ │ ├── plus.coffee │ │ │ ├── slide.coffee │ │ │ └── z42.js │ │ │ └── css │ │ │ ├── _img │ │ │ ├── at.jpg │ │ │ ├── bg.png │ │ │ ├── logo.png │ │ │ ├── LoginBg.png │ │ │ ├── img-bg.jpg │ │ │ ├── snsIcon.png │ │ │ ├── LoginText.png │ │ │ ├── icon-menu.png │ │ │ └── LoginFormIcon.png │ │ │ ├── layout.css │ │ │ ├── plus.css │ │ │ ├── tip_com.css │ │ │ ├── slidejs.css │ │ │ ├── lside.css │ │ │ └── tip_user.css │ ├── robots.txt │ ├── sina_verified_check.txt │ ├── css │ │ ├── __init__.py │ │ ├── _img │ │ │ ├── icon.png │ │ │ ├── pointer.png │ │ │ ├── shihui.png │ │ │ ├── icon-date.png │ │ │ ├── touziren.gif │ │ │ ├── warmuptk.png │ │ │ ├── icon-express.png │ │ │ ├── m │ │ │ │ └── root │ │ │ │ │ ├── arrow.png │ │ │ │ │ ├── cloud.png │ │ │ │ │ ├── item1.png │ │ │ │ │ ├── item2.png │ │ │ │ │ ├── item3.png │ │ │ │ │ ├── logo.png │ │ │ │ │ ├── mark.png │ │ │ │ │ ├── mark1.png │ │ │ │ │ ├── mark2.png │ │ │ │ │ ├── mark3.png │ │ │ │ │ ├── point.png │ │ │ │ │ ├── mark21.png │ │ │ │ │ ├── mark31.png │ │ │ │ │ ├── mingpian.png │ │ │ │ │ ├── touxiang.png │ │ │ │ │ └── triangle.png │ │ │ └── root │ │ │ │ ├── slideup.png │ │ │ │ ├── txt-mark.png │ │ │ │ ├── platform-banner.png │ │ │ │ └── slideup-light.png │ │ ├── _lib │ │ │ ├── simditor │ │ │ │ ├── images │ │ │ │ │ ├── fork.png │ │ │ │ │ ├── logo.png │ │ │ │ │ ├── image.png │ │ │ │ │ ├── title.png │ │ │ │ │ ├── logo@2x.png │ │ │ │ │ ├── title@2x.png │ │ │ │ │ └── loading-upload.gif │ │ │ │ ├── merge.sh │ │ │ │ └── simditor-emoji.css │ │ │ ├── jquery-ui │ │ │ │ └── images │ │ │ │ │ ├── animated-overlay.gif │ │ │ │ │ ├── ui-icons_222222_256x240.png │ │ │ │ │ ├── ui-icons_228ef1_256x240.png │ │ │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ │ │ ├── ui-icons_469bdd_256x240.png │ │ │ │ │ ├── ui-icons_cd0a0a_256x240.png │ │ │ │ │ ├── ui-icons_d8e7f3_256x240.png │ │ │ │ │ ├── ui-icons_ef8c08_256x240.png │ │ │ │ │ ├── ui-icons_ffd27a_256x240.png │ │ │ │ │ ├── ui-icons_ffffff_256x240.png │ │ │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ │ │ ├── ui-bg_flat_100_202079_40x100.png │ │ │ │ │ ├── ui-bg_flat_100_ffffff_40x100.png │ │ │ │ │ ├── ui-bg_flat_10_000000_40x100.png │ │ │ │ │ ├── ui-bg_flat_55_F26522_40x100.png │ │ │ │ │ ├── ui-bg_flat_55_fbec88_40x100.png │ │ │ │ │ ├── ui-bg_flat_75_2D54AA_40x100.png │ │ │ │ │ ├── ui-bg_flat_85_3B70E1_40x100.png │ │ │ │ │ ├── ui-bg_glass_100_f6f6f6_1x400.png │ │ │ │ │ ├── ui-bg_glass_100_fdf5ce_1x400.png │ │ │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ │ │ ├── ui-bg_gloss-wave_35_f6a828_500x100.png │ │ │ │ │ ├── ui-bg_diagonals-thick_18_b81900_40x40.png │ │ │ │ │ ├── ui-bg_diagonals-thick_20_666666_40x40.png │ │ │ │ │ ├── ui-bg_highlight-soft_100_eeeeee_1x100.png │ │ │ │ │ └── ui-bg_highlight-soft_75_ffe45c_1x100.png │ │ │ ├── aliceui │ │ │ │ ├── button │ │ │ │ │ └── src │ │ │ │ │ │ └── ui-button-disable.css │ │ │ │ └── form │ │ │ │ │ └── src │ │ │ │ │ └── label.css │ │ │ ├── imgareaselect │ │ │ │ └── imgareaselect-default.css │ │ │ ├── page.css │ │ │ ├── srobbin-jquery-pageslide │ │ │ │ ├── jquery.pageslide.css │ │ │ │ └── examples │ │ │ │ │ └── _secondary.html │ │ │ ├── jquery_pageslide.css │ │ │ └── uploader.css │ │ ├── _env.py │ │ └── readme.rst │ ├── doc │ │ └── source │ │ │ ├── example.py │ │ │ ├── _image │ │ │ ├── clone.png │ │ │ ├── login1.png │ │ │ ├── login2.png │ │ │ ├── login3.png │ │ │ ├── reset1.png │ │ │ ├── reset2.png │ │ │ ├── reset3.png │ │ │ ├── encoding.png │ │ │ ├── getkeys.png │ │ │ ├── makekeys.png │ │ │ ├── register.png │ │ │ ├── xshell_font.png │ │ │ ├── xshell_ft.png │ │ │ ├── filetransfer.png │ │ │ └── xshell_font_btn.png │ │ │ ├── _static │ │ │ ├── aaaaa.png │ │ │ ├── login.png │ │ │ ├── main.png │ │ │ ├── rst.png │ │ │ ├── sync.png │ │ │ ├── adduser.png │ │ │ ├── banshou.png │ │ │ ├── favicon.ico │ │ │ ├── notify.png │ │ │ ├── addgroup.png │ │ │ ├── addgroup2.png │ │ │ ├── addtogroup.png │ │ │ ├── figs │ │ │ │ └── magic-2.png │ │ │ ├── unreadnotify.png │ │ │ ├── addusertogroup.png │ │ │ └── translations.js │ │ │ ├── mvvm.rst │ │ │ ├── api │ │ │ └── index.rst │ │ │ ├── database │ │ │ └── index.rst │ │ │ ├── web │ │ │ └── index.rst │ │ │ ├── index.rst │ │ │ ├── 42qu.rst │ │ │ ├── plan.rst │ │ │ └── sso.rst │ ├── img │ │ ├── more.png │ │ └── background_1.gif │ ├── SITE │ │ ├── upload.swf │ │ └── favicon.ico │ ├── yuicompressor.jar │ └── _env.py ├── z42 │ ├── lib │ │ ├── __init__.py │ │ ├── mail_tmpl.py │ │ ├── reddit │ │ │ ├── _sorts.so │ │ │ ├── install.sh │ │ │ └── __init__.py │ │ ├── re_pattern.py │ │ ├── time_tool.py │ │ ├── txt2html.py │ │ ├── b64hash.py │ │ ├── b64uuid.py │ │ ├── jsonrpclib │ │ │ └── __init__.py │ │ ├── ip.py │ │ ├── luhn.py │ │ ├── unique.py │ │ ├── xor_encrypt.py │ │ └── num2code.py │ ├── web │ │ ├── __init__.py │ │ ├── lib │ │ │ ├── txt.py │ │ │ ├── __init__.py │ │ │ ├── qbox │ │ │ │ ├── __init__.py │ │ │ │ └── _env.py │ │ │ ├── _env.py │ │ │ └── txt_diff.py │ │ ├── boot │ │ │ ├── __init__.py │ │ │ ├── gae │ │ │ │ ├── __init__.py │ │ │ │ ├── prepare.sh │ │ │ │ ├── dev.sh │ │ │ │ ├── upload_index.sh │ │ │ │ ├── _env.py │ │ │ │ ├── _dev.sh │ │ │ │ ├── dev.py │ │ │ │ ├── app_yaml.py │ │ │ │ ├── upload.sh │ │ │ │ ├── upload_backend.sh │ │ │ │ └── init.sh │ │ │ ├── serve.sh │ │ │ ├── index.py │ │ │ ├── install.sh │ │ │ ├── prepare.sh │ │ │ ├── dev.sh │ │ │ ├── restart.py │ │ │ ├── restart.sh │ │ │ ├── serve.py │ │ │ └── coffee_const.py │ │ ├── sms │ │ │ ├── __init__.py │ │ │ ├── _env.py │ │ │ ├── sms_new.py │ │ │ ├── smsbao.py │ │ │ └── sms_twilio.py │ │ ├── mysql │ │ │ ├── __init__.py │ │ │ └── orm │ │ │ │ ├── __init__.py │ │ │ │ ├── _env.py │ │ │ │ └── _db.py │ │ ├── _patch │ │ │ ├── __init__.py │ │ │ ├── _env.py │ │ │ ├── test.py │ │ │ └── _morsel.py │ │ ├── config │ │ │ ├── __init__.py │ │ │ └── _env.py │ │ ├── memcache │ │ │ ├── __init__.py │ │ │ └── _env.py │ │ ├── view │ │ │ └── _env.py │ │ ├── _env.py │ │ ├── route.py │ │ ├── cgi.py │ │ ├── mail.py │ │ ├── render.py │ │ └── _import.py │ ├── __init__.py │ ├── captcha │ │ ├── r.ttf │ │ └── __init__.py │ ├── config │ │ ├── _signal.py │ │ ├── __init__.py │ │ └── _env.py │ └── _env.py ├── zapp │ ├── __init__.py │ └── _WEB │ │ ├── __init__.py │ │ ├── js │ │ └── __init__.py │ │ ├── misc │ │ ├── __init__.py │ │ ├── crontab │ │ │ └── __init__.py │ │ ├── config │ │ │ └── make │ │ │ │ ├── make.py │ │ │ │ └── _env.py │ │ ├── mysql.sql │ │ └── backup │ │ │ └── mysql │ │ │ └── _env.py │ │ ├── model │ │ ├── __init__.py │ │ ├── god │ │ │ ├── __init__.py │ │ │ ├── readme.txt │ │ │ └── _env.py │ │ ├── rpc │ │ │ ├── __init__.py │ │ │ ├── client │ │ │ │ ├── __init__.py │ │ │ │ ├── _gearman.py │ │ │ │ ├── index.py │ │ │ │ ├── _env.py │ │ │ │ └── mail.py │ │ │ └── server │ │ │ │ ├── _enabled.py │ │ │ │ ├── run.py │ │ │ │ ├── index.py │ │ │ │ ├── mail.py │ │ │ │ ├── _gearman.py │ │ │ │ ├── __init__.py │ │ │ │ ├── _env.py │ │ │ │ └── search.py │ │ ├── ob_cid.py │ │ ├── _env.py │ │ ├── gid.py │ │ ├── sso_sign.py │ │ ├── _db.py │ │ ├── sign.py │ │ ├── id_by_sso.py │ │ ├── mongo_raw_backup.py │ │ ├── admin_log.py │ │ ├── user_info.py │ │ └── verify_code.py │ │ └── view │ │ ├── __init__.py │ │ ├── _rpc │ │ ├── god.py │ │ ├── _env.py │ │ ├── upload.py │ │ ├── _route.py │ │ └── client.py │ │ ├── _env.py │ │ ├── _j.py │ │ ├── _route.py │ │ └── sso.py ├── .idea │ ├── .name │ ├── scopes │ │ └── scope_settings.xml │ ├── encodings.xml │ ├── vcs.xml │ ├── misc.xml │ ├── PegasusWang-z42-f7779b354fa9.iml │ └── modules.xml ├── css │ ├── __init__.py │ ├── _img │ │ ├── icon.png │ │ ├── pointer.png │ │ ├── shihui.png │ │ ├── icon-date.png │ │ ├── touziren.gif │ │ ├── warmuptk.png │ │ ├── icon-express.png │ │ ├── m │ │ │ └── root │ │ │ │ ├── arrow.png │ │ │ │ ├── cloud.png │ │ │ │ ├── item1.png │ │ │ │ ├── item2.png │ │ │ │ ├── item3.png │ │ │ │ ├── logo.png │ │ │ │ ├── mark.png │ │ │ │ ├── mark1.png │ │ │ │ ├── mark2.png │ │ │ │ ├── mark3.png │ │ │ │ ├── point.png │ │ │ │ ├── mark21.png │ │ │ │ ├── mark31.png │ │ │ │ ├── mingpian.png │ │ │ │ ├── touxiang.png │ │ │ │ └── triangle.png │ │ └── root │ │ │ ├── slideup.png │ │ │ ├── txt-mark.png │ │ │ ├── slideup-light.png │ │ │ └── platform-banner.png │ ├── _lib │ │ ├── simditor │ │ │ ├── images │ │ │ │ ├── fork.png │ │ │ │ ├── image.png │ │ │ │ ├── logo.png │ │ │ │ ├── title.png │ │ │ │ ├── logo@2x.png │ │ │ │ ├── title@2x.png │ │ │ │ └── loading-upload.gif │ │ │ ├── merge.sh │ │ │ └── simditor-emoji.css │ │ ├── jquery-ui │ │ │ └── images │ │ │ │ ├── animated-overlay.gif │ │ │ │ ├── ui-icons_222222_256x240.png │ │ │ │ ├── ui-icons_228ef1_256x240.png │ │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ │ ├── ui-icons_469bdd_256x240.png │ │ │ │ ├── ui-icons_cd0a0a_256x240.png │ │ │ │ ├── ui-icons_d8e7f3_256x240.png │ │ │ │ ├── ui-icons_ef8c08_256x240.png │ │ │ │ ├── ui-icons_ffd27a_256x240.png │ │ │ │ ├── ui-icons_ffffff_256x240.png │ │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ │ ├── ui-bg_flat_10_000000_40x100.png │ │ │ │ ├── ui-bg_flat_55_F26522_40x100.png │ │ │ │ ├── ui-bg_flat_55_fbec88_40x100.png │ │ │ │ ├── ui-bg_flat_75_2D54AA_40x100.png │ │ │ │ ├── ui-bg_flat_85_3B70E1_40x100.png │ │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ │ ├── ui-bg_flat_100_202079_40x100.png │ │ │ │ ├── ui-bg_flat_100_ffffff_40x100.png │ │ │ │ ├── ui-bg_glass_100_f6f6f6_1x400.png │ │ │ │ ├── ui-bg_glass_100_fdf5ce_1x400.png │ │ │ │ ├── ui-bg_gloss-wave_35_f6a828_500x100.png │ │ │ │ ├── ui-bg_diagonals-thick_18_b81900_40x40.png │ │ │ │ ├── ui-bg_diagonals-thick_20_666666_40x40.png │ │ │ │ ├── ui-bg_highlight-soft_100_eeeeee_1x100.png │ │ │ │ └── ui-bg_highlight-soft_75_ffe45c_1x100.png │ │ ├── aliceui │ │ │ ├── button │ │ │ │ └── src │ │ │ │ │ └── ui-button-disable.css │ │ │ ├── form │ │ │ │ └── src │ │ │ │ │ └── label.css │ │ │ └── table │ │ │ │ └── dist │ │ │ │ └── table.css │ │ ├── imgareaselect │ │ │ └── imgareaselect-default.css │ │ ├── page.css │ │ ├── srobbin-jquery-pageslide │ │ │ ├── jquery.pageslide.css │ │ │ └── examples │ │ │ │ └── _secondary.html │ │ ├── jquery_pageslide.css │ │ └── uploader.css │ ├── _env.py │ └── readme.rst ├── coffee │ ├── require.js │ │ └── dependence.coffee │ └── _lib │ │ ├── avalon_view.coffee │ │ ├── z42.coffee │ │ ├── rpc.coffee │ │ └── avalon_ext.coffee ├── .hg_archival.txt ├── hg_sync.sh ├── _env.py ├── requirements.txt ├── _lua_debug.py ├── html │ └── _base │ │ ├── default.html │ │ ├── rss.html │ │ └── mail.html ├── print_ac_route ├── print_route └── .hgignore ├── bigdata └── .gitignore ├── diagrams ├── .gitignore ├── README.md ├── demo.py └── demo2.py ├── design_pattern ├── .cache │ └── v │ │ └── cache │ │ └── lastfailed ├── python-patterns │ ├── __init__.py │ ├── .gitignore │ ├── append_output.sh │ ├── chaining_method.py │ ├── decorator.py │ └── test_strategy.py ├── t.py ├── enum_t.py └── lazy_property.py ├── chrome ├── .gitignore ├── README.md ├── control.js └── control.py ├── README.md ├── calibre ├── .gitignore ├── parse.py └── README.md ├── web ├── cookie_secret ├── iptools.py ├── escape_unescape_html.py ├── gen_secret.py ├── url_encode_unquote.py ├── myip.py ├── encrypt_password.py └── httpauth.py ├── crawler ├── proxy │ ├── run.bat │ ├── proxy.py │ ├── readme.txt │ └── pysqlite-2.3.3.win32-py2.4.exe ├── _env.py ├── src │ ├── grequests_crawler.py │ ├── server.py │ ├── search_engine_header.py │ ├── test.py │ └── sync_spider.py ├── proxy.log └── tofetch.txt ├── socket_programming ├── event_loop │ ├── coro.png │ ├── tcp_server_blocking.py │ ├── asyncio_tcp_echo_server.py │ ├── echo_server_select.py │ └── tcp_bench.go ├── event_loop_select.py ├── tcp_client.py ├── 0_blocking_socket_http.py ├── tornado_server.py └── doc_tcp_server.py ├── book_codes └── Python网络编程Linux │ ├── struct_demo.py │ ├── socket05c.py │ └── socket05s.py ├── github └── miio.py ├── .gitignore ├── mail ├── config.py ├── 搭建smtp服务器.md └── cloudsend.py ├── text_html ├── markdown_to_html.py ├── inflection_tools.py ├── t.py ├── html2text_tool.py └── encoding_decoding_tool.py ├── iterm2 └── iter2.py ├── img └── tinyfy_image.py ├── tools └── mac_wathch_and_refresh_chrome.sh ├── os ├── kill_process.py ├── multiple_cmd.py └── walk_all.py ├── algorithm_datastructure └── binary_search.py ├── debugtools └── terminal_color_print.py ├── raw └── parse.py ├── thread └── multi_process.py ├── coroutine └── subprocess_target.py ├── funny ├── draw_heart.py └── ascii_print.py ├── date_time ├── get_day_of_month.py └── to_timestamp.py ├── kafka_demo └── consumer.py └── stock └── sina.py /z42/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /z42/js/_WEB/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /z42/static/x.txt: -------------------------------------------------------------------------------- 1 | 3 2 | -------------------------------------------------------------------------------- /z42/z42/lib/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /z42/z42/web/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /z42/z42/web/lib/txt.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /z42/zapp/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bigdata/.gitignore: -------------------------------------------------------------------------------- 1 | *.txt 2 | -------------------------------------------------------------------------------- /z42/z42/web/boot/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /z42/z42/web/lib/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /z42/z42/web/sms/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /z42/zapp/_WEB/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /z42/zapp/_WEB/js/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /z42/static/js/_WEB/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /z42/z42/web/boot/gae/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /z42/z42/web/lib/qbox/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /z42/z42/web/mysql/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /z42/zapp/_WEB/misc/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /z42/zapp/_WEB/model/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /z42/zapp/_WEB/view/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /diagrams/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *.png 3 | -------------------------------------------------------------------------------- /z42/z42/__init__.py: -------------------------------------------------------------------------------- 1 | import _env 2 | -------------------------------------------------------------------------------- /z42/zapp/_WEB/misc/crontab/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /z42/zapp/_WEB/model/god/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /z42/zapp/_WEB/model/rpc/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /design_pattern/.cache/v/cache/lastfailed: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /design_pattern/python-patterns/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /z42/.idea/.name: -------------------------------------------------------------------------------- 1 | PegasusWang-z42-f7779b354fa9 -------------------------------------------------------------------------------- /z42/zapp/_WEB/model/god/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /z42/zapp/_WEB/model/rpc/client/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /chrome/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.png 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 大量干货,个人和工作常用的代码收集,包括一些好的开源项目和常用代码工具。 2 | -------------------------------------------------------------------------------- /calibre/.gitignore: -------------------------------------------------------------------------------- 1 | *.mobi 2 | *.pdf 3 | *.epub 4 | -------------------------------------------------------------------------------- /design_pattern/python-patterns/.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | -------------------------------------------------------------------------------- /z42/static/html/sort/test/2.json: -------------------------------------------------------------------------------- 1 | {"title":"撒大声地","brief":"阿斯达"} -------------------------------------------------------------------------------- /z42/static/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | 4 | -------------------------------------------------------------------------------- /web/cookie_secret: -------------------------------------------------------------------------------- 1 | 4E2TrpteR/KDVQ0f4V70HY2S3bqeTk41gBfGYQ4KT8M= 2 | -------------------------------------------------------------------------------- /z42/js/hack/placeholder.js: -------------------------------------------------------------------------------- 1 | $('input, textarea').placeholder(); 2 | -------------------------------------------------------------------------------- /z42/static/sina_verified_check.txt: -------------------------------------------------------------------------------- 1 | 1032784ba7cbabc73df2d73f4eb50784 -------------------------------------------------------------------------------- /z42/z42/lib/mail_tmpl.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | -------------------------------------------------------------------------------- /z42/js/__init__.py: -------------------------------------------------------------------------------- 1 | import _hash_ 2 | 3 | vars().update(vars(_hash_)) 4 | -------------------------------------------------------------------------------- /z42/static/js/hack/placeholder.js: -------------------------------------------------------------------------------- 1 | $('input, textarea').placeholder(); 2 | -------------------------------------------------------------------------------- /z42/z42/web/_patch/__init__.py: -------------------------------------------------------------------------------- 1 | import _morsel 2 | import _tornado 3 | -------------------------------------------------------------------------------- /z42/z42/web/mysql/orm/__init__.py: -------------------------------------------------------------------------------- 1 | from model import Model, ModelMc 2 | -------------------------------------------------------------------------------- /z42/css/__init__.py: -------------------------------------------------------------------------------- 1 | import _hash_ 2 | 3 | vars().update(vars(_hash_)) 4 | -------------------------------------------------------------------------------- /z42/static/css/__init__.py: -------------------------------------------------------------------------------- 1 | import _hash_ 2 | 3 | vars().update(vars(_hash_)) 4 | -------------------------------------------------------------------------------- /z42/static/js/__init__.py: -------------------------------------------------------------------------------- 1 | import _hash_ 2 | 3 | vars().update(vars(_hash_)) 4 | -------------------------------------------------------------------------------- /z42/js/foot.js: -------------------------------------------------------------------------------- 1 | //require("//hm.baidu.com/hm.js?890835ff6f3f123078e3621b4272bd97") 2 | -------------------------------------------------------------------------------- /z42/static/js/foot.js: -------------------------------------------------------------------------------- 1 | //require("//hm.baidu.com/hm.js?890835ff6f3f123078e3621b4272bd97") 2 | -------------------------------------------------------------------------------- /crawler/proxy/run.bat: -------------------------------------------------------------------------------- 1 | :loop 2 | cls 3 | C:\Python24\python.exe proxy.py 4 | pause 5 | goto loop -------------------------------------------------------------------------------- /z42/static/doc/source/example.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | 4 | print "Hello" 5 | -------------------------------------------------------------------------------- /z42/coffee/require.js/dependence.coffee: -------------------------------------------------------------------------------- 1 | #init : 2 | # deps : [ 3 | # 'jquery' 4 | # ] 5 | 6 | -------------------------------------------------------------------------------- /z42/css/_img/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/icon.png -------------------------------------------------------------------------------- /z42/z42/captcha/r.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/z42/captcha/r.ttf -------------------------------------------------------------------------------- /z42/zapp/_WEB/model/rpc/server/_enabled.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | 4 | import mail 5 | -------------------------------------------------------------------------------- /crawler/proxy/proxy.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/crawler/proxy/proxy.py -------------------------------------------------------------------------------- /crawler/proxy/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/crawler/proxy/readme.txt -------------------------------------------------------------------------------- /z42/css/_img/pointer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/pointer.png -------------------------------------------------------------------------------- /z42/css/_img/shihui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/shihui.png -------------------------------------------------------------------------------- /z42/static/img/more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/static/img/more.png -------------------------------------------------------------------------------- /diagrams/README.md: -------------------------------------------------------------------------------- 1 | # python 画架构图 2 | 3 | https://pythondict.com/python-paintings/python-draw-system-architecture/ 4 | -------------------------------------------------------------------------------- /z42/css/_img/icon-date.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/icon-date.png -------------------------------------------------------------------------------- /z42/css/_img/touziren.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/touziren.gif -------------------------------------------------------------------------------- /z42/css/_img/warmuptk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/warmuptk.png -------------------------------------------------------------------------------- /z42/js/_lib/uploadify.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/js/_lib/uploadify.swf -------------------------------------------------------------------------------- /z42/static/SITE/upload.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/static/SITE/upload.swf -------------------------------------------------------------------------------- /z42/css/_img/icon-express.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/icon-express.png -------------------------------------------------------------------------------- /z42/css/_img/m/root/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/m/root/arrow.png -------------------------------------------------------------------------------- /z42/css/_img/m/root/cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/m/root/cloud.png -------------------------------------------------------------------------------- /z42/css/_img/m/root/item1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/m/root/item1.png -------------------------------------------------------------------------------- /z42/css/_img/m/root/item2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/m/root/item2.png -------------------------------------------------------------------------------- /z42/css/_img/m/root/item3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/m/root/item3.png -------------------------------------------------------------------------------- /z42/css/_img/m/root/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/m/root/logo.png -------------------------------------------------------------------------------- /z42/css/_img/m/root/mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/m/root/mark.png -------------------------------------------------------------------------------- /z42/css/_img/m/root/mark1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/m/root/mark1.png -------------------------------------------------------------------------------- /z42/css/_img/m/root/mark2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/m/root/mark2.png -------------------------------------------------------------------------------- /z42/css/_img/m/root/mark3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/m/root/mark3.png -------------------------------------------------------------------------------- /z42/css/_img/m/root/point.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/m/root/point.png -------------------------------------------------------------------------------- /z42/css/_img/root/slideup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/root/slideup.png -------------------------------------------------------------------------------- /z42/js/_lib/webcam/webcam.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/js/_lib/webcam/webcam.swf -------------------------------------------------------------------------------- /z42/static/SITE/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/static/SITE/favicon.ico -------------------------------------------------------------------------------- /z42/static/css/_img/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/static/css/_img/icon.png -------------------------------------------------------------------------------- /z42/static/html/sort/js/plus.coffee: -------------------------------------------------------------------------------- 1 | $(".plus").click -> 2 | $(this).append """+1""" 3 | -------------------------------------------------------------------------------- /z42/static/yuicompressor.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/static/yuicompressor.jar -------------------------------------------------------------------------------- /z42/z42/lib/reddit/_sorts.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/z42/lib/reddit/_sorts.so -------------------------------------------------------------------------------- /z42/css/_img/m/root/mark21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/m/root/mark21.png -------------------------------------------------------------------------------- /z42/css/_img/m/root/mark31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/m/root/mark31.png -------------------------------------------------------------------------------- /z42/css/_img/root/txt-mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PegasusWang/collection_python/HEAD/z42/css/_img/root/txt-mark.png -------------------------------------------------------------------------------- /z42/js/hack/ie8.js: -------------------------------------------------------------------------------- 1 | function LOAD(js){ document.write('\ 8 | <%block name="head">%block>\ 9 |
hehe
')) 25 | -------------------------------------------------------------------------------- /z42/z42/lib/luhn.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | 4 | 5 | def luhn_verify(code): 6 | code = code.replace(' ', '').strip() 7 | if not code.isdigit(): 8 | return False 9 | sum = 0 10 | for i in xrange(len(code)): 11 | c = int(code[-i-1]) 12 | if i % 2: 13 | v = c * 2; 14 | sum += (v - 9) if (v > 9) else v 15 | else: 16 | sum += c 17 | return sum % 10 == 0 18 | 19 | if __name__ == '__main__': 20 | print luhn_verify('5324505101636252') 21 | print luhn_verify('532450510163625') 22 | 23 | -------------------------------------------------------------------------------- /algorithm_datastructure/binary_search.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding:utf-8 -*- 3 | 4 | 5 | def bsearch(l, to_search): 6 | beg = 0 7 | end = len(l) - 1 8 | while beg < end: 9 | mid = beg + int((end - beg) / 2) 10 | if l[mid] < to_search: 11 | beg = mid + 1 12 | elif l[mid] > to_search: 13 | end = mid 14 | else: 15 | return mid 16 | return -1 17 | 18 | 19 | def test(): 20 | l = list(range(10)) 21 | assert bsearch(l, 1) == 1 22 | assert bsearch(l, 0) == 0 23 | assert bsearch(l, 10) == -1 24 | -------------------------------------------------------------------------------- /z42/coffee/_lib/z42.coffee: -------------------------------------------------------------------------------- 1 | 2 | window.def_view = _def_view = (id, ctrl)-> 3 | avalon.define( 4 | id, 5 | ctrl 6 | ) 7 | 8 | $ -> 9 | window.def_view = (id, ctrl)-> 10 | v = _def_view(id,ctrl) 11 | avalon.scan() 12 | return v 13 | 14 | window.def_edit_view = (name, callback) -> 15 | def_view( 16 | name 17 | (v) -> 18 | v.is_edit = 0 19 | v.edit = -> 20 | V[name].is_edit = 1 21 | v.cancel = -> 22 | V[name].is_edit = 0 23 | callback(v) 24 | ) 25 | -------------------------------------------------------------------------------- /mail/cloudsend.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | #coding:utf-8 3 | import requests, json 4 | 5 | url="http://sendcloud.sohu.com/webapi/mail.send.json" 6 | 7 | # 不同于登录SendCloud站点的帐号,您需要登录后台创建发信子帐号,使用子帐号和密码才可以进行邮件的发送。 8 | params = { 9 | "api_user": "pegasus_test_kTfGDH", 10 | "api_key" : "aQbHk7BlDJizBwyF", 11 | "from" : "service@sendcloud.im", 12 | "fromname" : "网站测试", 13 | "to" : "291374108@qq.com", 14 | "subject" : "来自SendCloud的第一封邮件!", 15 | "html": "欢迎提出改进建议""", 16 | "resp_email_id": "true", 17 | } 18 | 19 | r = requests.post(url, files={}, data=params) 20 | print r.text 21 | -------------------------------------------------------------------------------- /z42/zapp/_WEB/view/_j.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | 4 | import _env 5 | import json 6 | import tornado 7 | from yajl import loads, dumps 8 | from zapp._WEB.view._user import View 9 | 10 | 11 | class JsonLoginView(View): 12 | 13 | def prepare(self): 14 | super(JsonLoginView, self).prepare() 15 | if not self.current_user_id: 16 | callback = self.get_argument('callback', None) 17 | result = '{"err":{"code": 403}}' 18 | if callback: 19 | result = "%s(%s)"%(callback,result) 20 | self.finish(result) 21 | 22 | -------------------------------------------------------------------------------- /z42/zapp/_WEB/view/_route.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | 4 | import _env 5 | from zapp._WEB.model.host import cid_by_host 6 | from z42.web.route import Route 7 | 8 | class _CidMatch(object): 9 | pattern = None 10 | def __init__(self, cid): 11 | self.cid = cid 12 | 13 | def match(self, host): 14 | if cid_by_host(host) == self.cid: 15 | return True 16 | 17 | class RouteByCid(Route): 18 | def __init__(self, cid, prefix=''): 19 | self.handlers = [] 20 | self._prefix = prefix 21 | self.host = _CidMatch(cid) 22 | 23 | 24 | -------------------------------------------------------------------------------- /z42/css/_lib/imgareaselect/imgareaselect-default.css: -------------------------------------------------------------------------------- 1 | /* 2 | * imgAreaSelect default style 3 | */ 4 | 5 | 6 | .imgareaselect-border1, .imgareaselect-border2, 7 | .imgareaselect-border3, .imgareaselect-border4 { 8 | filter: alpha(opacity=50); 9 | opacity: 0.5; 10 | } 11 | 12 | .imgareaselect-handle { 13 | background-color: #fff; 14 | border: solid 1px #000; 15 | filter: alpha(opacity=50); 16 | opacity: 0.5; 17 | } 18 | 19 | .imgareaselect-outer { 20 | background-color: #000; 21 | filter: alpha(opacity=50); 22 | opacity: 0.5; 23 | } 24 | 25 | .imgareaselect-selection { 26 | } 27 | -------------------------------------------------------------------------------- /z42/zapp/_WEB/model/sign.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding:utf-8 3 | 4 | 5 | import _env 6 | from z42.web.mongo import Doc 7 | from zapp._WEB.model._db import redis, R 8 | 9 | 10 | class Sign(Doc): 11 | structure = dict( 12 | id=int, 13 | txt=str, 14 | ) 15 | 16 | @staticmethod 17 | def new(user_id, txt): 18 | if txt: 19 | Sign(dict(txt=str(txt))).upsert(dict(id=int(user_id))) 20 | 21 | 22 | @staticmethod 23 | def by_user_id(user_id): 24 | s = Sign.find_one(dict(id=int(user_id))) 25 | return s.txt if s else "" 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /z42/css/_lib/page.css: -------------------------------------------------------------------------------- 1 | 2 | .page{ 3 | font-size:15px; 4 | color: #444; 5 | line-height:150%; 6 | text-align:left; 7 | } 8 | .page a,.page span{ 9 | padding:0 8px 2px; 10 | line-height:27px; 11 | /*margin:3px 10px;*/ 12 | margin:1px 3px; 13 | text-decoration:none; 14 | display:inline-block; 15 | color:#444; 16 | } 17 | .page a:hover{ 18 | padding-bottom:2px; 19 | border-bottom:2px solid #d20; 20 | color:#d20; 21 | } 22 | .page span{ 23 | color:#ccc; 24 | } 25 | .page .now{ 26 | color:#000; 27 | border-bottom:2px solid #01A; 28 | } 29 | .page .pgt{ 30 | padding-right:0; 31 | } 32 | .page .plt{ 33 | padding-left:0; 34 | } 35 | -------------------------------------------------------------------------------- /z42/static/css/_lib/imgareaselect/imgareaselect-default.css: -------------------------------------------------------------------------------- 1 | /* 2 | * imgAreaSelect default style 3 | */ 4 | 5 | 6 | .imgareaselect-border1, .imgareaselect-border2, 7 | .imgareaselect-border3, .imgareaselect-border4 { 8 | filter: alpha(opacity=50); 9 | opacity: 0.5; 10 | } 11 | 12 | .imgareaselect-handle { 13 | background-color: #fff; 14 | border: solid 1px #000; 15 | filter: alpha(opacity=50); 16 | opacity: 0.5; 17 | } 18 | 19 | .imgareaselect-outer { 20 | background-color: #000; 21 | filter: alpha(opacity=50); 22 | opacity: 0.5; 23 | } 24 | 25 | .imgareaselect-selection { 26 | } 27 | -------------------------------------------------------------------------------- /socket_programming/0_blocking_socket_http.py: -------------------------------------------------------------------------------- 1 | import socket 2 | import time 3 | 4 | 5 | def get(path): 6 | s = socket.socket() 7 | s.connect(('localhost', 5000)) 8 | 9 | request = 'GET {} HTTP/1.0\r\n\r\n'.format(path) 10 | s.send(request.encode()) 11 | 12 | chunks = [] 13 | while True: 14 | chunk = s.recv(1000) 15 | if chunk: 16 | chunks.append(chunk) 17 | else: 18 | body = (b''.join(chunks)).decode() 19 | print(body) 20 | return 21 | 22 | 23 | start = time.time() 24 | get('/1') 25 | get('/2') 26 | print(time.time() - start) 27 | -------------------------------------------------------------------------------- /z42/static/css/_lib/page.css: -------------------------------------------------------------------------------- 1 | 2 | .page{ 3 | font-size:15px; 4 | color: #444; 5 | line-height:150%; 6 | text-align:left; 7 | } 8 | .page a,.page span{ 9 | padding:0 8px 2px; 10 | line-height:27px; 11 | /*margin:3px 10px;*/ 12 | margin:1px 3px; 13 | text-decoration:none; 14 | display:inline-block; 15 | color:#444; 16 | } 17 | .page a:hover{ 18 | padding-bottom:2px; 19 | border-bottom:2px solid #d20; 20 | color:#d20; 21 | } 22 | .page span{ 23 | color:#ccc; 24 | } 25 | .page .now{ 26 | color:#000; 27 | border-bottom:2px solid #01A; 28 | } 29 | .page .pgt{ 30 | padding-right:0; 31 | } 32 | .page .plt{ 33 | padding-left:0; 34 | } 35 | -------------------------------------------------------------------------------- /socket_programming/tornado_server.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding:utf-8 -*- 3 | 4 | import random 5 | 6 | import tornado 7 | from tornado.web import RequestHandler 8 | 9 | 10 | class SleepHandler(RequestHandler): 11 | 12 | @tornado.gen.coroutine 13 | def get(self, name): 14 | yield tornado.gen.sleep(1) 15 | return name 16 | 17 | 18 | app = tornado.web.Application( 19 | [ 20 | (r'/(.*)', SleepHandler) 21 | ], debug=True 22 | ) 23 | 24 | 25 | app.listen(5000) 26 | try: 27 | tornado.ioloop.IOLoop.current().start() 28 | except: 29 | tornado.ioloop.IOLoop.current().stop() 30 | -------------------------------------------------------------------------------- /z42/z42/web/sms/smsbao.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | #coding:utf-8 3 | import _env 4 | from urllib import urlencode 5 | import urllib2 6 | import logging 7 | from z42.config import SMSBAO 8 | 9 | def sms_new(code, phone, txt): 10 | code = int(code) 11 | data = { 12 | 'u': SMSBAO.USER, 13 | 'p': SMSBAO.PASSWORD, 14 | 'm': phone, 15 | 'c': txt, 16 | } 17 | url = 'http://www.smsbao.com/sms?%s' % urlencode(data) 18 | urllib2.urlopen(url, timeout=60) 19 | 20 | if __name__ == "__main__": 21 | pass 22 | sms_new("86", 13693622296 , "长生") 23 | sms_new("86", 18610542503 , "长生") 24 | -------------------------------------------------------------------------------- /z42/js/init.js: -------------------------------------------------------------------------------- 1 | function LOAD(js){ document.write('