Ron DuPlain - PyOhio 2013
This file contains hidden or 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
| #!/bin/bash | |
| for p in `ack -l 'gen.engine' --python`;do | |
| cat "$p"|sed 's/gen\.engine/gen\.coroutine/' >"$p".bak | |
| mv "$p".bak "$p" | |
| done; |
This file contains hidden or 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 os | |
| #书籍信息 | |
| title='test book' | |
| creator='scturtle' | |
| description='blablablabla' | |
| #章节文件 | |
| txtlist=['1.txt','2.txt'] |
This file contains hidden or 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
| //http://wbpkh5001.17c.cn/html5/ | |
| function clock(){ | |
| var color_map = {}; | |
| var unfound = true; | |
| var children = $('#box').children(); | |
| var i = 0; | |
| $.each(children, function(i, item){ | |
| var key = $(item).attr('style'); | |
| var nextkey = $(children[i+1]).attr('style'); | |
| var v = color_map[key]; |
This file contains hidden or 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 os | |
| import shutil | |
| l = "ar, bg, bn, br, bs, ca, ckb, cs, csb, cy, da, de, el, en, en_AU, en_CA, en_GB, eo, es, et, eu, fa, fi, fil, fo, fr, fy, ga, gl, gu, he, hi, hr, hu, id, is, it, ja, ka, kk, ko, ku, lt, lv, mk, ml, mr, ms, nb, nds, ne, nl, nn, oc, pa, pl, pt, pt_BR, ro, ru, si, sk, sl, sq, sr, sv, ta, te, th, tl, tr, uk, ur, vi, zh_CN, zh_HK, zh_TW, zu" | |
| for la in l.split(', '): | |
| la = la.strip() | |
| if not os.path.exists(la): | |
| shutil.copytree('gl', la) |
This file contains hidden or 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
| menuentry 'install deepin2014' { | |
| set root=(hd0,7) | |
| linux /install_deepin/vmlinuz.efi boot=casper noacpi iso-scan/filename=/install_deepin/deepin_2014_alpha_zh-hans_amd64.iso ro quiet splash locale=zh_CN.UTF-8 noprompt -- | |
| initrd /install_deepin/initrd.lz | |
| } |
This file contains hidden or 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
| #!/bin/zsh | |
| # pyenv install for CentOS 6.5 x86_64 | |
| yum install -y gcc gcc-c++ make git patch openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel | |
| git clone git://github.com/yyuu/pyenv.git ~/.pyenv | |
| export PATH="$HOME/.pyenv/bin:$PATH" | |
| eval "$(pyenv init -)" |
This file contains hidden or 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
| """ | |
| client.py - AsyncIO Server using StreamReader and StreamWriter | |
| This will create 200 client connections to a server running server.py | |
| It will handshake and run similar to this: | |
| Server: HELLO | |
| Client: WORLD |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>the5fire-backbone-router</title> | |
| </head> | |
| <body> | |
| <a href="#/posts/120">Post 120</a> | |
| <a href="#/download/user/images/hey.gif">download gif</a> | |
| <a href="#/dashboard/graph">Load Route/Action View</a> | |
| <script src="jquery.js"></script> |
This file contains hidden or 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 requests | |
| listurl = "http://www.xs8.cn/shuku/c0-t0-f0-w0-u0-o0-1-0.html" | |
| headers = { | |
| 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', | |
| 'Accept-Encoding': 'gzip,deflate,sdch', | |
| 'Accept-Language': 'zh-CN,zh;q=0.8,en-US;q=0.6,en;q=0.4', |
