About 张 子萌

个人喜欢读书、上网、聊天。希望朋友之间多交流。
11月 16

vim插件安装

“git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
“vim +PluginInstall +qall

"git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
"vim +PluginInstall +qall
set nocompatible              " be iMproved, required
filetype off                  " required

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'git://git.wincent.com/command-t.git'
Plugin 'file:///home/gmarik/path/to/plugin'
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
Plugin 'ascenator/L9', {'name': 'newL9'}
call vundle#end()            " required
filetype plugin indent on    " required
Plugin 'flazz/vim-colorschemes'
Plugin 'vim-scripts/pep8'
Plugin 'Valloric/YouCompleteMe'
Plugin 'Lokaltog/vim-powerline'
6月 27

微信接入验证消息python3+tornado

#!/bin/env python3
#-*- coding:utf-8 -*-
import tornado.ioloop
import tornado.locale
import tornado.web

import hashlib

class checkHandler(tornado.web.RequestHandler):
    def get(self):
        signature = self.get_argument('signature')
        timestamp = self.get_argument('timestamp')
        nonce = self.get_argument('nonce')
        echostr = self.get_argument('echostr')
        token = 'xxxxxxx'
        list1 = [token, timestamp, nonce]
        list1.sort()
        strList =  ''.join(list1)
        sha1 = hashlib.sha1()
        sha1.update(strList.encode('utf-8'))
        if sha1.hexdigest() == signature:
            self.write(echostr)
        else:
            self.write('')