Skip to content

Instantly share code, notes, and snippets.

View cloudchou's full-sized avatar

Cloud Chou cloudchou

View GitHub Profile
@cloudchou
cloudchou / python: get script dir
Last active May 16, 2018 15:57
python snippets
scriptDir=os.path.split(os.path.realpath(__file__))[0]
print(scriptDir)
@cloudchou
cloudchou / commit_blog.py
Last active November 19, 2016 01:52
提交博客的脚本
import sublime
import sublime_plugin
import time
from Git.git import GitTextCommand
import functools
import codecs
import re
class CommitBlogCommand(GitTextCommand):
@cloudchou
cloudchou / UyanCommentBackuper.py
Last active November 18, 2016 05:55
备份友言评论数据的脚本
# -*- coding: utf-8 -*-
import requests
from Tools.scripts.treesync import raw_input
from bs4 import BeautifulSoup
import re
from datetime import datetime
import demjson
common_headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)'
@cloudchou
cloudchou / new_blog.py
Last active May 16, 2018 12:56
新建博客文章的脚本
# -*- coding: utf8 -*-
import sublime
import sublime_plugin
import datetime
import time
import functools
import re
import codecs
import os
import sys
@cloudchou
cloudchou / cVim.rc
Last active September 4, 2017 03:12
cVim配置
map F createActiveTabbedHint
let searchengine zhihu = 'https://www.zhihu.com/search?q=%s'
let searchengine youdao = 'http://youdao.com/w/eng/%s'
let searchalias g = 'google'
let searchalias zh = 'zhihu'
let searchalias yd = 'youdao'
let previousmatchpattern = '((?!last)(prev(ious)?|上一(页|頁)?|newer|back|«|less|<<?|gigi‹fd| )+)'
let nextmatchpattern = '((?!first)(下一(页|頁)?|next|older|more|>>?|›|»|forward| )+)'
@cloudchou
cloudchou / MergeContent.py
Last active November 15, 2016 10:51
合并两个文件内容的python脚本
# -*- coding: utf8 -*-
#!/usr/bin/python
import os
import re
import codecs
import sys
import tempfile
import string
reload(sys)
@cloudchou
cloudchou / ConvmvLinuxToWindows
Created November 3, 2016 09:15
将linxu文件名换成windows文件名 解决乱码问题
convmv -f UTF-8 -t GBK --notest -r docs